Binary search - 1#9017

Binary search - 1

2 seconds
128 megabytes
Very easy

A sorted array of integers is given. You need to answer queries: how many times a given number appears in the array.

Input

The first line contains two numbers and q~(n, q \le 10^6). The second line contains integers sorted in increasing order. Each of the following lines contains a single value . All numbers in the array do not exceed 10^9 in absolute value.

Output

For each value of , print the number of times it occurs in the array in a separate line.

Examples

Example 1

Loading
Loading

Example 3

Loading
Loading