code: https://ide.codingblocks.com/s/401284
problem : https://codeforces.com/contest/1165/problem/E
In the solution Im not able to understand how modulo is being used. More specifically I don’t understand why it is used multiple times and still the solution is correct.