hi,

I m posting a game, its like this:

Suppose N people are playing the game. All of them are numbered from 1 to N.
They all sit in a circle such that their numbering order is also maintained,
so that the last person (numbered N) sits adjacent to the first person
(numbered 1). Now an integer K is chosen. Starting from the first person,
every Kth person is removed from the game, and whenever a person is removed,
the counting begins again from the next person onwards. This continues until
only 1 person remains. He is declared the winner.

so N and k is given to us and we have to tell that who will be the last
person.

can any one plz help me to find the solution of this problem.
I tried and got the solution by simulatio. taking an array of length N and
the go on removing untill one person remains.
if any other good method is there plz help me.......



-- 
Manish Kumar Garg
M.Tech IIT Kharagpur,
09732657489
[EMAIL PROTECTED]

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/algogeeks
-~----------~----~----~----~------~----~------~--~---

Reply via email to