To solve the problem we need knowledge about how Loop works and some basic arithmetic operations. We need to do the following tasks:

  1. Find each day’s spiders who will get fully recovered. And can calculate this using mod(%) operation, i.e (a1  % K)

  2. Sum all of N day’s results we get from doing the task of above (1). 

Time Complexity: O(TestCase * N)

Statistics

98% Solution Ratio
MursaleenEarliest, Apr '21
the.shoaib2Fastest, 0.0s
MursaleenLightest, 131 kB
Jitendra_BaruaShortest, 142B
Toph uses cookies. By continuing you agree to our Cookie Policy.