#c22501. 二分查找
二分查找
Binary Search Counts
Problem Description
There are numbers and queries.
Each query gives a number ; you must answer, among , how many numbers are less than , equal to , and greater than respectively.
Input Format
The first line contains two integers . The next line contains integers, the sequence .
The following lines each contain one integer .
Output Format
Output lines, each containing three integers: the answer.
Sample Input
6 6
3 5 1 5 3 5
1
2
3
4
5
6
Sample Output
0 1 5
1 0 5
1 2 3
3 0 3
3 3 0
6 0 0
Constraints
For of the data: , .