UVa 180 - Eeny Meeny

This is the known josephus problem. The statement "Eeeny men...." is 15 letter, so we are in the circle and will kill some each time we count 15...Usualli dynamic programming solve josephus problem in fast time....There is a relation between a circle with size n ad you kill with count m one, then m+1, then m+2...

n = size of circle, cycle the value we iterate with and kill here is 15 for(i = 2; i <=num; i++) killed = (killed + cycle) % i;

This is the simples josephus problem, but in this problem you will need bit work.