Einee-Meenie-Minee-Mo (04)

A group of friends are standing in a circle playing a game.  They proceed around the circle, chanting the rhyme and pointing to the next person (clockwise) on each word.  When the rhyme finishes whoever is being pointed at leaves the circles.  Then they start again, pointing where they left off, and the game continues until only one person is left.

The version of the rhyme they are using is

Eeny, meeny, miny, moe,

Catch a tiger by the toe.

If he hollers, let him go,

Eeny, meeny, miny, moe.

Write a program, which given the number of friends and the length of the rhyme, can determine who wins. 

Taken from the 2004 Informatics Olympiad.  

Click here to view all the competition tasks. 

© British Informatics Olympiad

Leave a Reply

Your e-mail address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.