Solved by 421 users: ...
UserDateAttemptTimeCMSC
sb3ar`24 apr 2008`Ruby400.0232
sb3ar`24 apr 2008`Ruby300.0234
david_it21`19 apr 2008`Ruby500.0340
zhuojie`13 feb 2008`Python100.0743
crazyb0y`11 feb 2008`C++500.0149
UlyaNick`29 mar 2009`Ruby200.0351
crazyb0y`11 feb 2008`C++400.0152
vi002`18 jul 2007`Ruby200.0354
VyatkaSU`29 sep 2010`Python500.0755
fetetriste`10 apr 2007`Ruby600.0258
VyatkaSU`29 sep 2010`Python400.0759
cyberian`19 feb 2007`Python800.0859
crazyb0y`11 feb 2008`C++300.0160
faraaz102`19 feb 2007`Python1000.0862
crazyb0y`22 jan 2008`C++100.0163
cyberian`19 feb 2007`Python700.0763
faraaz102`19 feb 2007`Python900.0764
 C++ 221 FPC 120 Java 31 C 31 Kylix 15 Python 7 Ruby 5 Perl 2
` >  >  >  >  >  >  >  >  >  > `

## Stone Game -- who is the winner?

Time limit = 5

You are to determine the status of a position in Stone Game, that has the following rules.

There are k stone piles with n1, n2, ... , nk stones. One is permitted to take 2m stones from one pile for a move. The one who takes the last stone(s) wins.

Input contains the number of piles and their sizes delimited with spaces or/and newline symbols. k < 50, ni < 10200.

Output either the string "First wins." or the string "Second wins." (without quotes).

 Input#1```3 3 2 1 ``` Output#1```First wins. ```
 Input#2```5 111 777 777 9999999999 9999999999 ``` Output#2```Second wins. ```

Author:
Well-known problem. Added by Voroztsov Artem.

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

 © acm.mipt DevGroupThe page was generated in 180ms