Question: . Here is the classical programming puzzle though it came from ancient times when there are no computers at all. We can see that practicing

 . Here is the classical programming puzzle though it came from

. Here is the classical programming puzzle though it came from ancient times when there are no computers at all. We can see that practicing math and logic can sometimes save one's life! About 2000 years ago there was some war, and during one of its battles defendants were blocked by attackers in the cave. To avoid capture, they decided to stand in a circle and kill every third person until only one person remains - who was supposed to commit suicide - though he eventually preferred to surrender to the enemies. position of a person who remains alive (and surrenders to the enemies) .See example below for N-10, and K-3 Ist round: 12 (3)45 (6) 7 8 (9) 10 2nd round: 3rd round: 4th round: 5th round: (081045)10 4(610 ( 1 (2) 45 (7) 10 (1)45 (8) 10 4 (5) 10 4

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!