First Value At Least X — Solution & Editorial
Sort once, then answer each query with lower_bound (binary search for the leftmost position with value ≥ X).
Complexity: O((N + Q) log N)
Sort once, then answer each query with lower_bound (binary search for the leftmost position with value ≥ X).
Complexity: O((N + Q) log N)