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.
InputThe 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.
OutputTo 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 3Output:
2
1
1Submit solution
Coming laterThe grading service will be connected in a later migration step. You can inspect the task and your previous results now.