the problem http://www.codechef.com/PRST2013/problems/P1308

has accepted solution

http://www.codechef.com/viewsolution/1811877

what is the concept behind the code …its a tricky problem…

the problem http://www.codechef.com/PRST2013/problems/P1308

has accepted solution

http://www.codechef.com/viewsolution/1811877

what is the concept behind the code …its a tricky problem…

1 Like

This problem is a very standard classical problem known as Josephus problem. You can find a plenty of problems as direct application of it in the contest. The following links contains a good explanation of the problem:

Some of the problems on codechef that can be solved using the Josephus problem are:

I hope it helps.

1 Like

one good and detailed study of josephus problem is done in the COncrete MAthematics By Graham,Knuth and patashnik … Its very entertaining to study and even more interesting to implement…

1 Like