Binary Search - 1#227

Binary Search - 1

4 seconds
128 megabytes
Easy (≈1000)

An array consisting of sorted integers is given. You are required to answer queries: how many times does occur in the array.

Input

The first line contains integers and q~(n, q \le 10^6). The next line contains integers given in increasing order. Each of the following lines contains the variable . The integers in the array do not exceed 10^9 in absolute value.

Output

For each value of , output in separate lines the number of times occurs in the array.

Examples

Example 1

Loading
Loading

Example 3

Loading
Loading