Gửi bài giải
Điểm:
1,50 (OI)
Giới hạn thời gian:
1.0s
Giới hạn bộ nhớ:
256M
Input:
stdin
Output:
stdout
Nguồn bài:
Dạng bài
Ngôn ngữ cho phép
C, C++, Java, Kotlin, Pascal, PyPy, Python, Scratch
You are given ~n~ integers and ~m~ query. For each query, you are given a number ~b~, you should output the number of elements among given integers that less than or equal to ~b~.
Input
The first line contains two integers ~n~, ~m~ (~1~ ≤ ~n~, ~m~ ≤ ~10^{5}~).
The second line contains ~n~ integers (~-10^{9}~ ≤ ~ai~ ≤ ~10^{9}~).
The third line contains ~m~ integers representing ~m~ queries (~-10^{9}~ ≤ ~bj~ ≤ ~10^{9}~).
Output
- For each query, output the number of elements in ~a~ that less than or equal to ~b~.
Sample Input
5 3
0 3 5 6 9
4 2 8
Sample Output
2 1 4
Bình luận