Query multiples

You are given an array arr with indices numbered from 1 to N.
You will be given Q queries of the form i X. This query means, consider all arr[i], arr[i+1], .. arr[N] and, among these numbers, output the number of multiples of X.
Input:
First line consists of two integers; N and Q.
Next Q lines consist of one query, as described in the problem statement.
Output:
Output Q lines, the answer for each query.
Constraints:
1<=N<=10^5
1<=Q<=10^5
1<=X<=20000
1<=arr[i]<=20000
Sample Input(Plaintext Link)
3 1
9 6 2
2 2
Sample Output(Plaintext Link)
2

 

This Question is not yet answered!

 
 

Related Answered Questions

 

Related Open Questions