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

int main() {
    std::vector<int> numbers = {1, 2, 2, 2, 3, 4, 4, 5};

    int target = 3;

    // 使用 std::lower_bound() 函数在已排序的向量中查找第一个不小于指定值的元素
    auto result = std::lower_bound(numbers.begin(), numbers.end(), target);

    // 输出查找结果
    if (result != numbers.end()) {
        std::cout << "First element not less than or equal to " << target << " is: " << *result << std::endl;
    } else {
        std::cout << "No element not less than or equal to " << target << " found in the vector." << std::endl;
    }

    return 0;
}
