As you know, football U-17 world cup is going on. The next match of India is scheduled today. It is going to be started soon. But a problem comes in front of the Indian Captain AK. His father thinks studies are as important as sports. So he is not allowing his son to play the next game until he solves the given question . AK can solve this problem but due to lack of time, he wants you to help him. As you want India to win today, help AK in solving the given question.
Suppose there are N mountains on earth. The height(in cms) of all the mountains above the sea level is given. The height of the mountain can be 0. So you are given Q queries, you have to find no. of mountains in the range of height between L and R(both L & R inclusive) .
INPUT:
The first line of input consists of a two space separated integers N and Q respectively.
The next line of input consists of N space separated integers .
The next Q line of input consists of two space separated integers L and R .
OUTPUT:
Print the answer of ith query in ith line of output for all 1 ≤ i ≤ Q.
CONSTRAINTS:
1 ≤ N, Q ≤ 100000
0 ≤ Ai, L ,R ≤ 10^9
L ≤ R
,
In 1st query, there are 5 mountains of height in the range 1 to 5.
In 2nd query, there is only one mountain of height in the range 10 to 15.
Rest queries are self-explanatory.
All the participants need to register on the given link: goo.gl/MDh9FR