Tasks:
 
Task DescriptionDiscussion (0)
Task :: Cookies
Mirko and Slavko have got several boxes of cookies. In order to divide the cookies, they decided to play the following game. First One of them will take one cookie from any of the boxes, then the other one will take one, and so on... The first to take the last cookie from any of the boxes, is the winner, and takes all the remaining cookies as the prize.

Slavko can choose whether he should play first, be the first one to take a cookie. And he is asking you for help. Of course he wants to get as many cookies as possible.

INPUT:
The standard input will contain exactly three lines. Each of the three lines will represent one test case. The first number in each of the three lines will represent the number of the boxes K (2 <= K <= 50). The next K numbers in that line will represent the number of cookies in each of the boxes. All the boxes will contain from 1 to 100 cookies.

OUTPUT:
To the standard output write three integers, each in a separate line, representing the solutions for the three test cases. Output 1 if Slavko should start playing first, or 2 if Slavko should start playing second.


Input:
2 2 2
3 3 2 1
4 3 2 3 3

Output:
2
1
1
Submit Solution
:
:
Available Languages
Task info
Name:Cookies
Time:0.2 sec.
Memory:16 MB
#Tests:10
AddedBy: admin
Task Ratings
Difficulty:

3.3 (25 votes)
Quality:

4.4 (20 votes)
Acceptance Rate
Recent Submissions
Fastest Solutions
UserTime
gnocuil 0 s.
carlosjoa 0 s.
mario93 0 s.
gates 0 s.
msantl 0 s.
Tmarice 0 s.
OuyangJialin 0 s.
kiki034 0 s.
syntax_error 0 s.
djole9000 0 s.
Solved By