Number Of Multiples.

Revision en2, by UnfilledDreams, 2018-05-18 01:56:33

I was solving a problem but I couldn't solve that problem.
Given an array of N elements, we have to answer Q queries in each query two number i and X will be given we have to find how many multiples of X will be there in the array after the ith (including i) index. The range of N, Q is 10^5 and same for the array elements.
Please help me out with the logic.
Thanks in advance.

Tags #math

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English UnfilledDreams 2018-05-18 01:56:33 52
en1 English UnfilledDreams 2018-05-18 01:53:38 404 Initial revision (published)