help with codeforces problem 369C

Revision en2, by Gilgamesh_017, 2016-06-26 04:01:15

hello codeforces

can any one please tell me how to solve this problem link ,I tried several methods and none of them worked , I also read the tutorial for this problem but it was not clear for me :(

thanks

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English Gilgamesh_017 2016-06-26 04:01:15 3
en1 English Gilgamesh_017 2016-06-26 04:00:28 290 Initial revision (published)