Amplitude's latest feature request is for frequency queries. More specifically, a customer has
Constraints
Subtask 1 [1 point]
Subtask 2 [1 point]
No additional constraints.
Input Specification
The first line of input contains two positive integers,
The next line contains
Each of the next
Output Specification
Output
Sample Input
3 10
0 1 3
0 0
0 1
0 2
0 3
1 1
1 2
1 3
2 2
2 3
3 3
Sample Output
1
2
2
3
1
1
2
0
1
1
Sample Explanation
There are three users. One has performed the event zero times, one has performed the event once, and one has performed the event three times. Over all the frequency queries, the only one that returns zero is the one asking for how many users have performed the event exactly twice.
Comments