Counting Haybales#10559

Counting Haybales

1 second
128 megabytes
Very easy

Farmer John has just arranged his haybales at various points along the one-dimensional road running across his farm. To make sure they are spaced out appropriately, please help him answer queries, each asking for the number of haybales within a specific interval along the road.

Input

The first line contains n~(1 \le n \le 10^5) and q~(1 \le q \le 10^5). The next line contains distinct integers, each in the range 0~...~10^9, indicating that there is a haybale at each of those locations.

Each of the next lines contains two integers and b~(0 \le a \le b \le 10^9) giving a query for the number of haybales between and , inclusive.

Output

You should write lines of output. For each query, output the number of haybales in its respective interval.

Examples

Example 1

Loading
Loading