Solved by 302 users: ...
UserDateAttemptTimeCMSC
crazyb0y`11 feb 2008`C++800.71103
crazyb0y`22 jan 2008`C++100.01119
zhuojie`29 oct 2009`Python201.18120
Woland`13 may 2010`Ruby400.08127
bush`07 mar 2006`Ruby100.09135
Philip_PV`07 apr 2009`C300.02142
Woland`13 may 2010`Ruby300.08146
david_it21`12 dec 2008`Ruby200.08151
Philip_PV`07 apr 2009`C200.01153
Madiyar_Tktl`14 jan 2008`C++800.01161
UlyaNick`23 mar 2009`Ruby100.06163
UlyaNick`23 mar 2009`Ruby200.06163
Madiyar_Tktl`14 jan 2008`C++600.01164
ich`11 jul 2006`C200.02165
jx_wuyi`04 may 2008`C++100.01166
 C++ 177 FPC 85 C 17 Java 12 Kylix 8 Ruby 4 Python 1
` >  >  >  >  >  >  >  >  >  > `

## Camomile Game -- who is the winner?

Time limit = 5 seconds

The Camomile Game has following rules. Camomile is a flower with N petals.

Two playes make their moves in turn. For a move a player can pull out any petal or two petals growing side by side.

The player who can't make move looses.

It's easy to find out that the second player has winning strategy for N > 2.

We have M camomiles each with one petal pulled out. Your program should determine who has winning strategy in this game.

Input The number of camomiles M, 1 ≤ M ≤ 10 folowed by M lines with numbers of petals on camomiles Ni ( Ni < 200 ).

Output Line with "`First wins.`" or "`Second wins.`".

 Input#1```1 10 ``` Output#1```First wins. ```
 Input#2```2 10 10 ``` Output#2```Second wins. ```
 Input#3```3 6 7 8 ``` Output#3```Second wins. ```

Author:
Voroztsov Artem

<PREV | Problem set | Search related messages | NEXT>

 © acm.mipt DevGroupThe page was generated in 170ms