Waterloo 2001 Fall 1 E - A Multiplication Game
View as PDFStan and Ollie play the game of multiplication by multiplying an integer
by one of the numbers
to
. Stan always starts with
,
does his multiplication, then Ollie multiplies the number, then Stan and
so on. Before a game starts, they draw an integer
and the winner is who first reaches
. Each
line of input contains one integer number
. For each line of input
output one line, either
Stan wins. or Ollie wins., assuming that
both of them play perfectly.
Sample Input
162
17
34012226
Sample Output
Stan wins.
Ollie wins.
Stan wins.
Comments