Problems

# Binary search - 1

# Binary search - 1

Sorted array of **n** integers is given. You must answer **q** queries: how many times the given number **x** appears in the array.

#### Input

First line contains two numbers **n** and **q** (**n**, **q** ≤ `10`

). Second line contains ^{6}**n** integers sorted in increasing order. Each of the next **q** lines contains value of **x**. The numbers in array do not exceed `10`

by absolute value.^{9}

#### Output

For each value of **x** print on a separate line the number of times it appears in array.

Input example #1

6 3 2 4 4 8 11 14 10 4 2

Output example #1

0 2 1

Input example #2

8 4 -8 -8 -1 1 3 4 6 8 4 10 -4 -8

Output example #2

1 0 0 2