Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.
Query multiples
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