Sum of elements in matrix module some value

Правка en1, от Vasiljko, 2018-03-17 01:32:19

Given N, М and K. All nubers are  <  = 109
Define value of matrix in row i and column j as (i + j) mod K where i <  = N and j <  = M

Given Q <  = 2 * 105 queries of form Li, Lj, Ri, Rj and you need to find sum of elements from submatrix with upper-left corner (Li, Lj) and lower-right corner (Ri, Rj) module 109 + 7.

Some ideas? (There is a solution for this problem but it is not really clear to me, so I'm asking for maybe different ideas)

Теги #math, #number theory

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en3 Английский Vasiljko 2018-03-20 13:04:31 116
en2 Английский Vasiljko 2018-03-17 01:52:02 6 Tiny change: ' elements from submatrix' -> ' elements in submatrix'
en1 Английский Vasiljko 2018-03-17 01:32:19 503 Initial revision (published)