How to handle large number of queries related to finding LCM of all numbers in the range [L,R]??

Правка en1, от thebruisedsoul, 2015-10-08 23:20:43

I am trying to solve this problem, which provides an array of N integers , and requires to compute for M number of queries LCM of all the elements of the array in the range of indices [L,R] . As the answer can be very large print it modulo 10^9+7. 1<=M<=100000 1<=L<=R<=N. Please help to solve this problem.

Теги lcm, number theory

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский thebruisedsoul 2015-10-08 23:20:43 486 Initial revision (published)