How to solve this problem?

Revision en2, by ryoko1, 2017-09-30 19:44:41

Here is the link to the problem : Your text to link here... The problem tag says that it is a math related problem,but I am not able to find the logic behind it. I did find a solution on geeksforgeeks for a similar type of problem but the implementation seems a bit vague since there is no explanation provided as to how the logic was deduced. Here is the link for gfg sol : Your text to link here... It would be of great help if someone could explain me the logic behind this solution.

Tags spoj

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English ryoko1 2017-09-30 19:44:41 5 Tiny change: 'bit vague as there is ' -> 'bit vague since there is '
en1 English ryoko1 2017-09-30 19:43:31 603 Initial revision (published)