Number of elements in unimodal sequence
Easy
Execution time limit is 2 seconds
Runtime memory usage limit is 128 megabytes
Sequence is called unimodal if there exists such index that and . For the given value of find how many times it appears in array.
Input
The first line contains the size of array and number of queries . The next line contains positive integers that represent a unimodal sequence. Each of the next lines contains value of . Numbers in array do not exceed .
Output
For each value of print in a separate line the number of times it appears in array.
Examples
Input #1
Answer #1
Input #2
Answer #2
Submissions 334
Acceptance rate 31%