Einee-Meenie-Minee-Mo

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. 

Resources

Taken from the 2004 Informatics Olympiad.  

Click here to view all the competition tasks. 

© British Informatics Olympiad

About CDB 360 Articles
Self-Employed Software Developer, Spark, Property Management, Hobby Forestry, Ex-Teacher, Engineering - Wood, Metal, Electrics & Computers. Outdoors - Walk, Cycle, Kitesurf,

Be the first to comment

Leave a Reply

Your email address will not be published.


*


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