#include #include #include int main() { std::vector v{5, 2, 9, 1, 5, 6}; std::sort(v.begin(), v.end()); std::println("sorted:"); for (int n : v) std::print("{} ", n); std::println(""); int key = 5; auto it = std::lower_bound(v.begin(), v.end(), key); if (it != v.end() && *it == key) std::println("lower_bound of {} is at index {}", key, std::distance(v.begin(), it)); else std::println("key not found"); return 0; }