AtCoder Beginner contest 103c — Modulo Summation

Revision en1, by Nayem., 2019-09-19 07:45:02

I was trying to solve this problem

let, int moded = x % A here, the highest value of moded can be A-1;

but if we add some other numbers.. then.. (x % A1) + (x % A2) + .... + (x % An) then what can be the highest result if we add all the moded from Ai to An for this sequence?

for each Ai, if we take Ai-1, then the result will be maximum, but will there always exist an x if we were to get this maximum result?

Tags #modular arithmetic, #number theory, #modulo summation

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English Nayem. 2019-09-19 07:45:02 539 Initial revision (published)