11 2 s 64 MB

You are given a sequence of **n** integers **a _{1} , a_{2} , ... , a_{n}** in non-decreasing order. In addition to that, you are given several queries consisting of indices

The input consists of several test cases. Each test case starts with a line containing two integers **n** and **q** (*1 ≤ n, q ≤ 100000*). The next line contains **n** integers **a _{1} , ... , a_{n}** (

query.

The last test case is followed by a line containing a single *0*.

For each query, print one line with one integer: The number of occurrences of the most frequent value within the given range.

## Sample Input | ## Sample Output |
---|---|

10 3 -1 -1 1 1 1 1 3 10 10 10 2 3 1 10 5 10 0 | 1 4 3 |