#include <algorithm>
#include <iostream>
#include <vector>

int main() {
    const std::vector<double> v{1.5, 3.1, 12.88, 32.4};

    const auto x = 13.0;
    auto it = std::adjacent_find(v.begin(), v.end(),
                                 [x](double lhs, double rhs){ return lhs <= x && x < rhs; });
    if (it != v.end()) {
        std::cout << *it << " " << *(it + 1) << std::endl;
    }
}
