<PREV Problem:
NEXT>
Solved by 421 users: ...
UserDateAttemptTimeCMSC
sb3ar24 apr 2008Ruby400.0232 
sb3ar24 apr 2008Ruby300.0234 
david_it2119 apr 2008Ruby500.0340 
zhuojie13 feb 2008Python100.0743 
crazyb0y11 feb 2008C++500.0149 
UlyaNick29 mar 2009Ruby200.0351 
crazyb0y11 feb 2008C++400.0152 
vi00218 jul 2007Ruby200.0354 
VyatkaSU29 sep 2010Python500.0755 
fetetriste10 apr 2007Ruby600.0258 
VyatkaSU29 sep 2010Python400.0759 
cyberian19 feb 2007Python800.0859 
crazyb0y11 feb 2008C++300.0160 
faraaz10219 feb 2007Python1000.0862 
crazyb0y22 jan 2008C++100.0163 
cyberian19 feb 2007Python700.0763 
faraaz10219 feb 2007Python900.0764 
Languages
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 DevGroup
The page was generated in 180ms

SW soft NIX
ID = 18.207.106.142