#FREQ2. Most Frequent Value

Most Frequent Value

You are given a sequence of n integers a0, a1, ..., an-1. You are also given several queries consisting of indices i and j (0 ≤ i ≤ j ≤ n-1). For each query, determine the number of occurrences of the most frequent value among the integers ai, ..., aj.

Input

First line contains two integers n and q (1 ≤ n, q ≤ 100000). The next line contains n integers a0, ... ,an-1 (0 ≤ ai ≤ 100000, for each i ∈ {0, ..., n-1}) separated by spaces. The following q lines contain one query each, consisting of two integers i and j (0 ≤ i ≤ j ≤ n-1), which indicates the boundary indices for the query.

Output

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

Example

Input:

5 3
1 2 1 3 3
0 2
1 2
0 4

Output:
2
1
2

NOTE - This problem is similar to a problem Frequent values.

</p>