// Đề bài
Given a sorted array and a value x, output how many elements are less than or equal to x.
// Đầu vào
The first line contains an integer n (1 <= n <= 10^5). The second line contains n integers in non-decreasing order. The third line contains the query value x.
// Đầu ra
A single integer: the count of elements <= x.
// Gợi ý
A binary search (upper bound) answers each query in O(log n).