#include <vector>
#include <iostream>
#include <algorithm>
int main()
{
std::vector<double> vec;
for(double x{0.0}; x < 10.0 + 0.5; x += 1.0) vec.push_back(x);
auto it = std::upper_bound( vec.begin(), vec.end(), 5.5 );
if( it != vec.end() )
std::cout << "found:" << *it << std::endl;
}
I2luY2x1ZGUgPHZlY3Rvcj4KI2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8YWxnb3JpdGhtPgoKaW50IG1haW4oKQp7CiAgICBzdGQ6OnZlY3Rvcjxkb3VibGU+IHZlYzsKICAgIGZvcihkb3VibGUgeHswLjB9OyB4IDwgMTAuMCArIDAuNTsgeCArPSAxLjApIHZlYy5wdXNoX2JhY2soeCk7CiAgICBhdXRvIGl0ID0gc3RkOjp1cHBlcl9ib3VuZCggdmVjLmJlZ2luKCksIHZlYy5lbmQoKSwgNS41ICk7CiAgICBpZiggaXQgIT0gdmVjLmVuZCgpICkgCiAgICAJc3RkOjpjb3V0IDw8ICJmb3VuZDoiIDw8ICppdCA8PCBzdGQ6OmVuZGw7CiAgICAKfQ==