Problem Statement
Two players are playing a game with some tokens on a tree.
Player A has one or more red tokens. Player B has one or more blue tokens. Initially, each vertex of the tree is either empty or contains exactly one token (either a red one or a blue one, not both). During the game there can be arbitrarily many tokens of each color in each vertex.
You are given the description of the initial state of the game.
More precisely, you are given the
The game is played in rounds. Each round consists of two phases.
In the first phase player A may move some of his tokens, and in the second phase player B may move some of her tokens. More precisely, the current player always examines all of their tokens, and for each of them the player either decides to keep it in its current vertex, or decides to move it to one of the adjacent vertices.
Player B wins if after some round there is a vertex that contains both a red and a blue token. (There can even be multiple red or blue tokens in that vertex.)
Player B wants to win in as few rounds as possible. Player A wants the game to go for as many rounds as possible. Assume that both players play the game optimally.
Compute and return the number of rounds the game will take.
Note that it can be shown that the answer is always finite: player B always has a winning strategy. Also note that you are supposed to return the number of rounds, not the total number of phases.
Definition
- Class:
- Treestrat
- Method:
- roundcnt
- Parameters:
- int[], int[], int[]
- Returns:
- int
- Method signature:
- int roundcnt(int[] tree, int[] A, int[] B)
- (be sure your method is public)
Constraints
- tree will contain n - 1 element.
- n will be between 2 and 50, inclusive.
- i-th elements in tree will be between 0 and i, inclusive.
- A will contain between 1 and 50 elements, inclusive.
- B will contain between 1 and 50 elements, inclusive.
- Each element in A and B will be between 0 and n - 1, inclusive.
- No element will occur more than once in the concatenation of A and B.
Examples
{0}
{0}
{1}
Returns: 1
This is a tree with a single edge 0-1. Initially there is a red token in vertex 0 and a blue token in vertex 1. Regardless of where player A moves the red token, player B can move the blue token to the same vertex and win.
{0,1}
{1}
{2}
Returns: 2
This tree is a line that consists of two edges: 0-1 and 1-2. We start with a red token on vertex 1 and a blue token on vertex 2. Player A's optimal strategy is to start by moving his token into vertex 0. Player B will then move her token into vertex 1. In the second round player B will then win the game in the same way as in Example 0.
{0,0,0,3,4}
{2}
{1}
Returns: 2
{0,0,0,3,4,2}
{1}
{6}
Returns: 5
{0,0,0,3,4,2}
{1}
{6,5}
Returns: 3
{0,0,0,3,4,2}
{4,1}
{3,6}
Returns: 2
{0,0,1,1,4,0,0,2,2,5,7,1,5,7,11,3,8,3,2,11,9,8,15,4,7,1,5,6,1,17,26,19,21,33,32,35,29,11,27,23,31,32}
{20,5,14,2}
{31,38,25}
Returns: 2
{0,1,2,1,4,4,3,3,5,2,2,10,5,10,4,8,8,9,6,9,10,16,10,21,18,12}
{0,1,18,14,25,5}
{26}
Returns: 9
{0,1,2,3,2,4,4,2,6,1,4,11,11,6,9,10,3,2,0,6,2,13,14,16,20,5,20,5,22,12,23,10,20,4,25,35,12,32,14,12,3,16,42,32,16}
{15,21,1,5,33,41,31}
{9}
Returns: 1
{0,0,2,2,1,4,5,0}
{6,8}
{4,5,3,2}
Returns: 1
{0,1,2,2,1,2,1,4,6,1,2,3,12,12,1,14}
{0,7}
{15,14,5,8,1}
Returns: 1
{0,1}
{2}
{1,0}
Returns: 1
{0,1,2,2,3,2,4,4,2,9,10,3,10,13,3,11,6,10,3,8,0}
{10}
{18,14,13}
Returns: 6
{0,1,1,0,2,4,0,6,5,0,1,2,3,5,13,4,2,2,12,12,0,0,14,10,11,25,2,21,16,24,21,25,21,20,31,13,1,23,6}
{35,32,0,30,3}
{29}
Returns: 6
{0,1,0,3,3,4,1,6,7,8,10,9,6,4,2,9,12,17,13,16,18,14,11,17,5,2}
{8,13}
{24,10,0,20,3}
Returns: 4
{0,1,1,1,2,0,6,1,2,7,0,2}
{6}
{1,7}
Returns: 1
{0,0,1,2,3,5,2,1,1,2,6,8,2,1,6,1,8,12,14,1,7,8,5,1,11,23,11,1,26,14,21,20,6,15}
{5}
{20}
Returns: 6
{0,1,1,2,3,2,6,1,3,1,5,1,9,4,14,0,9,8,14,19,10}
{5,16,15,19,18}
{3,6,10}
Returns: 2
{0,0,2,3,2,1,0,1,4,4,1,8,9,13,13,8,12,17,1,11,8}
{2,18,3}
{0,17,20,14,15}
Returns: 1
{0,0,2,3,0,4,0,6,4,4,2,1,4}
{10,11,2,9,4,7,0}
{13}
Returns: 2
{0,0,2,2,0,0,1,3,6,4,5,10,4,11,7,9,7,15,15,9,8,13,0,14,12,19,26,13,8,25,6,16,10,14,31,26,13,17,0,11,4,27,20,2}
{28,35,16,32}
{14,30}
Returns: 7
{0,0,1,3,2,0,4,7,8,0,8,8,3,12,8,7,13,8,1,8,15,16,16,12,11}
{12}
{14}
Returns: 9
{0,1,0,0,1,3,0,5,6,1,10,9,0,2,7,0,1,12,14,1,0,17,10,5,9,14,21,7,18,12,19,6,21,6,2,5,36,37,33,3,9,1,5,12,40,12,14,14,38}
{25,9,21,20,26,34}
{5,33,0}
Returns: 2
{0,1,1,2}
{1}
{3,0}
Returns: 3
{0,1,0,1,1}
{2}
{5}
Returns: 2
{0,0,0,3,1,1,2,1}
{2}
{7,0,1,5}
Returns: 1
{0,1,0,0,0,4,2,5,7,5,4,6,9,0,9,10,12,11,1,5,1,15}
{16,0,13,17,1,8}
{2,4,9}
Returns: 1
{0,1,2,1,2,1,3,5,7,4,2,4,3}
{13,10,9,12}
{0,8,1,5}
Returns: 2
{0,1,1,2,3,4,2,1,6,4,0,11,9,3,14,10,1,12,11,15}
{19,14,12,18}
{10}
Returns: 7
{0,1,2,0,1,0,5,6,5,5,8,8,5,4,10,4,13,6,6,3,6,8,12,7,20,19,12,23,10}
{29}
{5,15,28,3,27,18,7,9}
Returns: 2
{0,0,2,0,1,0,1,0,7,0,7,3,6,0,13,11,14,11,4,6,2,20,9,21,24,18,24}
{14,16}
{3,22,15,25,27,5,9}
Returns: 4
{0,1,0,2,0,3,0,4,6,2,10,2,4,13,4,1,5,4,14,13,17,20,16,5,14,14,21,16,11,28,22,11,27,9,30,21,10,35,33,26}
{4}
{27,28,21}
Returns: 8
{0,0,2,1}
{4,3}
{1,2}
Returns: 1
{0,0,1,0,3,4,5,3,5,4,1,4,3,1,7,9,14,0,9,13,14,20,20,11,6,25,17,15,13,29,8,19,0,23,9,8,14,5,29,29,12,16,31,30,6,24,6,25,39}
{19,37,8,0}
{21,14,17}
Returns: 1
{0,1,0,3,2,2,5,2,2,0,9,6,8,9,1,13,10,5,10,18,15,18,11,12,6,11,4,12,7,10,18,19,28,24,33,0,2,23,17,31,17,19,9,39,38,33}
{27,13,19,40,33}
{0}
Returns: 3
{0,1,1,3,4,3,5,2,3,6,6,10,6,3,14,12,8,9,15,1,16,5,14}
{12,13,9,10,7}
{3,6,4}
Returns: 1
{0,1,1,1,2,4,2,2,7}
{0,3}
{6,2,4,5}
Returns: 2
{0,1,2,3,4,5,6,2,4}
{9}
{8,3,6,2}
Returns: 2
{0,0,0,0,2,1,0,2,5,7,6,2,3,12,3,15,9,0,12,0,7,21,22,15,11,15,17}
{19}
{20,10}
Returns: 4
{0,0,1,0,0,4,6,2,8,5,0,5,8,4,1,10,1,2,18,18,6,5,20,1,0,15,8,18,13,5,9,5,21,17,4,21,5,26,21,30}
{4,16,18,10,7,11}
{5}
Returns: 2
{0,1,1,1,2,2,6,7,8,0,0,4,2,1,2,5,7,4,15,6,4,4,16,0,24,21,25,19,27,9,18,29,10,3,11,22,24,25,27}
{34,29,20}
{15,13,1,12,8}
Returns: 2
{0,0,1,2,2,0,1,6,8,2,3,3,5,6,14,6,1}
{6,1,4,5,13}
{15}
Returns: 6
{0,0,0,3,4,3,4,0,3,8,5,6,0,6,5,4,2,5,5,4,2,7,15,17,6,2,16,27}
{25,19,2}
{4,13,6}
Returns: 1
{0,1,2,3,2,4,6,4,7,2,8,2,7,12,6,13,6,15,10,17,9,4,3,12,8,6,5,26,8,17}
{22,0,27,24}
{13,26}
Returns: 6
{0,1,0,0,1,4,2,0,5,9,10,9,0,3,8,10,6,2,11,1,8,7,8,18,2,12,4,14,7,17,25,19,29}
{6,30}
{8}
Returns: 5
{0,0,2,3,3,1,4,7,1,2,8,8,4,10,6,14,1,17,13,18,12,17,3,6,23,14,15,23,15,17,4,1,31,7,15,26,17,5}
{35}
{36}
Returns: 9
{0,0,1,3,0,1,0,4,5,8,4,5,5,10,8,4,2,8,16,8,9,21,13,1,15,9,0,0,5,18,6,11,21,5,1,20,22,34,35,39,27,24,31,28}
{44,25,23}
{3,22,28}
Returns: 1
{0,0,0,0,2,1,0,4,4,1,5,10,3,4,9,11,12,1,15,0,14,10,19,14,7,6,8,6,12}
{24,12}
{0,8,7,27,23,10,6}
Returns: 2
{0,1,2,1,1,2,6,3,0,2,9,5,1,9,12,12,7,5,17,19,18}
{16}
{21}
Returns: 4
{0,1,2,2,1,0,0,3,6,5,9,7,3,4,3,2,13,2,8,10,0,13,0,19,3,2,24,11,10,25,24,8,1,23,4,26,30,1,37,13,25,28,18,30,29,24,40,21,27}
{41,19,12,46,43}
{15}
Returns: 4
{0,0,0,0,1,1,6,2,8,3,1,0,3,13,5,1,13,14,7,18,7,13,0,21,20,23,16,26,1,3,8,6,23,11,27,4,13,22,7,10,11,7,37,17,44,19,5,7,43}
{26}
{9}
Returns: 9
{0,0,2,3,3,4}
{3}
{2}
Returns: 3
{0,1,0,3,2,2,2,5,7}
{5,7}
{4}
Returns: 6
{0,0,1,3,3,2,6,2,6,3,2,5,11,1,0,6,8,6,0,1,3,21,5,4,23,23,25,5,28,20,18,29,30,13,15,31,1,28,33,21,21,36}
{15,30,33,36}
{18,32,31}
Returns: 2
{0,1,1,2,3,4,4,6,3,7,0,6,7,4,4,0,1,16,14,15,15,10,14,2,3,7,11,2,3,25,9,31,12,4,1,9,35,5,6,20,19,1,2,24,11,17}
{15}
{17}
Returns: 6
{0,0,1,1,2,3,6,5,1,8,4,9,8,10,2,6,2,11,8,7,10,3,1,19,11,5,9,9,24,17,10,1,27,22,20,25,29,12,19,32,29,2,32,21,35,26,16,3}
{17}
{21,25}
Returns: 6
{0,1,0,3,3,1}
{2}
{5,6}
Returns: 2
{0,0,2,1,1,4,0,4,4,2,7,0,4,2,10,10,0,0,5,2,8,4,4,4,8,7,18,6,0,23,1,16,4}
{27}
{5}
Returns: 4
{0,0,1,0,0,4,6,1,7,6,4,6,5,0,6,2,15,14,7,8,8,12,9,18,10,19,10,27,25,20,0,7,32,5,6,5,26,13}
{36,22}
{6}
Returns: 2
{0,0,0,0,3,5,2,0,8,0,1,11,8,11,11,12,5,6,3,10,17,4,15,17,21,0,14,13,1,28,10,14,29,7,2,16,25,36,26,19,3,6,22}
{9,15,29,10}
{23,5,18}
Returns: 5
{0,0,0,0,2,1,0,0,1,3,4,8,11,7,7,12,0,5}
{7,12}
{17,18,9,1,2}
Returns: 3
{0,1,2,3,3,2,5,2,6,4,5,7,0,8,9,2,8,6,18,3,7,14,12,13,5,15,8,14,14}
{15,25,6,20}
{29,8,3,27}
Returns: 1
{0,0,0,1,4,0,2,5,3,4,2,0,7,8,10,14,9}
{6}
{17,3,13,2,5,16}
Returns: 2
{0,1,0,1,1,0,3,4,4,3,0,0,4,7,12,0,7,7,0,16,11,7,3,18,24,10,0,9,11,20,15,13,17,29,6,19,32,8,32,15,30,2,23,7,14,29,32}
{26}
{30,12}
Returns: 4
{0,0,2,3,3,0,5,5,2,7,9,1,1,2,6,13,2,6,16,10,16,3,8,18,2,20,16,1,25,14,28,18,20,24,15,26,14,21}
{16,35,7,12,37,19}
{4}
Returns: 4
{0,1,0,3,3,3,2,4,8,7,8,9,0,2,14,7,16,7,12,4,15,7}
{21}
{14,16,8,12,13}
Returns: 2
{0,0,1,1,4,0,0,2,2,5,7,1,5,7,11,3,8,3,2,11,9,8,15,4,7,1,5,6,1,17,26,19,21,33,32,35,29,11,27,23,31,32,18,29,29,7}
{6,26}
{8}
Returns: 7
{0,1,1,3,1,1,1,4,2,0,5,0,11,10,2,0,4,14,17,10,9,16,9,6,1,5,11,1,8,24,21,4,26,2,26,35,1,34,30,26,7,35}
{18,10,29,17,26,38,31,0,40,2,27,25,33,21,6,23,35,24,7,3,42,5,8,32}
{12,9,34,28,20,15}
Returns: 1
{0,0,0,0,0,5,2,7,4,9,3,5,7,1,10,9,15,14,12,16,8,20,19,21,23,7,12,12,16,24,22,15,18,24,5,8,34,11,23,13,7,13,5,1,0,39,18,10}
{21,7,20,6,0,13,1,32,24,44,19,10,3,35,45,12,46,14,42,38,22,30,11,39,4,16,17}
{5,37,8,28}
Returns: 1
{0,0,2,2,2,3,4,3,2,6,7,5,5,2,5,14,8,13,1,8,3,21,6,7,2,3,17,9,2,16,4,13,31,26,4,30,6,13,8,9,31}
{13,32}
{1,7,20,31,0,4,15,11,33,25,40,37}
Returns: 3
{0,1,1,3,2,4,6,1,8,2,3,6,5,11,11,15,6,5,0,15,0,11,15,8,7,15,20,8,17,28,24,14,19,30,26,26,25,33,36,10,21,8,4,11,12}
{14,26,24,7}
{41,30,33,12,8,6,34}
Returns: 2
{0,0,2,2,0,5,4,2,3,4,2,0,9,3,5,15,9,12,7,13,14,3,0,8,10,8,2,9,0,2,7,31,18,13,34,7,2,27,24,3,3,33,30,21,26}
{18,6}
{0,34}
Returns: 2
{0,1,2,2,0,1,5,7,2,6,3,1,5,0,14,7,0,11,16,16,1,20,13,19,16,24,21,23,22,28,6,31,19,12,27,28,2,4,38,10,20,0,41,31,33,34,33,10,34}
{27,24,25,29,28,23,20,2,12,46,37,11,45,14,10,16}
{30}
Returns: 9
{0,1,0,3,3,4,5,4,2,3,1,7,7,11,0,1,3,10,5,7,11,12,22,7,3,20,25,0,10,8,2,7,1,2,5,0,6,24,22,20,33,18,21,16,42}
{41,40,32}
{16,19,17,35,13,4,39,38,21}
Returns: 2
{0,1,0,1,4,5,0,4,3,5,8,6,9,12,9,12,3,5,17,3,3,19,14,19,17,20,4,2,19,2,8,15,4,13,4,5,2,10,27,14,35,31,28,18}
{43,44}
{17,29,21,13,6,10,32,18,41,30,36,15,2,26,7,39,8,42,38}
Returns: 1
{0,0,1,3,2,2,1,1,1,2,5,5,2,6,13,13,16,3,5,10,4,15,17,3,15,22,26,27,1,2,10,16,4,11,14,15,36,32,30,29,36}
{41,15}
{5}
Returns: 7
{0,0,0,1,0,1,2,0,3,1,6,3,5,10,7,4,11,12,13,10,8,21,13,23,21,17,9,11,20,1,23,0,20,8,24,33,6,16,33,32,12,5}
{2,27,28,24,39,17}
{4,19,37,31,16,6,40,5,10,38,34,7,25,9,12,29,18,32,1,33,8}
Returns: 1
{0,0,0,3,3,3,2,1,3,9,6,4,6,6,5,5,7,2,7,6,18,7,9,22,20,20,13,0,19,5,17,17,9,27,9,28,23,11,5,17,2,30,34}
{23,37,27}
{25,21,36,16,11,12,22}
Returns: 5
{0,0,2,0,2,2,4,5,3,4,6,10,3,13,3,5,5,12,14,14,9,6,5,8,13,20,5,15,0,20,16,1,31,31,21,34,22,0,28,13,21,38,36}
{13,42,23,2,35,0,16,36,41,33,5,4,28}
{22,6,26,43,40,24,31,25,30,21,20,34,15,3,9,19,39}
Returns: 1
{0,0,2,1,3,2,3,2,7,7,8,9,7,6,1,7,16,3,18,17,15,14,3,3,14,11,15,27,14,0,1,4,17,32,29,29,27,12,9,20,8,37,5,31}
{23,33,37,42,31,24,13,18,26,40,28}
{29,0,14,36,38,7,8,30,35,1,6,20,9,27,43,39,34,21,17,16}
Returns: 1
{0,1,1,1,0,4,4,4,1,5,5,7,10,4,13,6,9,11,6,1,4,16,19,18,9,2,12,26,7,26,12,30,1,20,3,3,22,1,6,39,4}
{23,2}
{27,3}
Returns: 5
{0,1,1,3,2,3,4,7,7,8,9,8,11}
{0,11,4,9}
{2}
Returns: 2
{0,1,1,3,4,4,5,7,7,9,9,11,11}
{10,3,11,4}
{9}
Returns: 1
{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16}
{10}
{4,14,9}
Returns: 2
{0,1,2,2,3,5,5,6,8,9,10,11,12,13,13,15,16,16,18,18,19,21,22,23,23,24,25,26}
{26,12,28}
{15,5,27,4,6,19}
Returns: 3
{0,0,1,3,4,5,5,7,7,8,9,11,11,13,14,15,15,17,18,19,19,20,21,22,23,24,25,26,27,28,29,31,31,33,34,35,36,37,37,39,40}
{17,22,30}
{41,2,15,1,9,32}
Returns: 9
{0,0,2,3,3,5,3,7,8,8,8,10,9,11,12,15,16,14,15,19,19,21,19,20,23}
{11,24,9}
{7,5,8,23,18}
Returns: 1
{0,1,2,2,3,3,3,6,7,6,7,8,10,10,14,15,14,15,18,19,18,20,21,21,23,24,26,25,26,29,28,28,30}
{3}
{27,6}
Returns: 4
{0,0,2,0,4,3,4,5,5,8,9,9,12,13,13,13,14,14}
{4,14,0,12,2,15}
{16}
Returns: 2
{0,0,2,2,3,2,3,5,7,7,9,11,10,12,13,15,16,16,16,18,19,21,21,23,24}
{2,13}
{5}
Returns: 4
{0,1,1,2,3,4,6,6,7,8,9,11,11,12,13,14,16,17,17,19,20,20,22,23,23,25,25,27,27,28,29,30,31,33,34,35,35,36,38,38,40,41,42,42,44,45}
{46,36,5,34}
{32,12,39,19}
Returns: 5
{0,1,2,2,3,5,5,7,8,9,10,10,11,13,13,15,15,16,18,19,20,21,22,23,23,24,26,26,27,29,29,30,32,32,34,35,35,37,38,38,39,41,41,42,43,44,46}
{5,21,43,24,33}
{41,23,44,46}
Returns: 2
{0,0,0,1,4,3,4,6,7,7,9,9,10,11,13,14,14,15,17,19,18,20,20,22,22,24,25,25,27,29,29,29,31,33}
{0}
{27,15,1,32,5,21,22,3}
Returns: 2
{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31}
{8}
{26}
Returns: 26
{0,1,2,3,4,5,6,7,8,9,10,11}
{7,0,10,3,12,1,2,9}
{4}
Returns: 4
{0,0,2,2,4,4,6,7,8,8,9,11,12,13}
{7}
{12,6,4,11,2,5}
Returns: 3
{0,1,2,2,4,5,6,7,8,8,9,10,11,12,13,14,16,16,18,18,20,21,21,23,24,24,26,27,27,28,30,30,32,32,34,34,35,36,38,38,39,41,41,42,44,44,45,46,48}
{12,7,37,9,23}
{41,29,28,16}
Returns: 4
{0,1,2,3,4,5,6,7,8,8,10,10,12,13,14,14,15,17,17,18,20,21,22,23,24,25,25,27,28,28,30,30,31,33,34,35,35,36,37,38,39,41,42,43,43,45,45,47,47}
{22,20,29}
{27,23,47,12}
Returns: 2
{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48}
{24,20,46,21,48,49,18,34,31}
{3,38,0,27}
Returns: 5
{0,0,2,2,3,4,6,6,7,9,9,11,11,12,14,14,15,17,18,18,20,21,22,22,23,25,25,26,27,28,29,30,32,32,34,35,36,37,38,39,40,40,41,43,43,44,46,47,48}
{29,40,7,8,41,15,38}
{6,11,2,34,22,5,28}
Returns: 1
{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48}
{49,41,12,45,10,18,3,39,23,29,46}
{37,16,43,47,36,5}
Returns: 2
{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48}
{8,41}
{2,25,27,14,24,34,22}
Returns: 6
{0,1,1,2,4,4,5,7,7,9,10,10,12,13,13,14,16,16,17,18,19,21,21,23,23,24,25,27,27,28,29,30,32,33,34,35,36,37,37,39,39,41,42,43,43,44,45,47,48}
{0,40,44,45,24,19}
{25,26,8}
Returns: 1
{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48}
{21,11,47,3}
{20,40,24,38}
Returns: 2
{0,0,2,2,4,4,6,7,7,8,9,11,12,12,13,15,15,17,17,19,19,20,21,23,24,25,25,27,27,29,29,31,31,33,34,35,35,36,38,39,40,40,42,42,43,44,45,46,48}
{12,17}
{46,35}
Returns: 22
{0,0,1,2,3,5,6,6,7,9,10,11,12,13,13,14,16,16,17,18,19,20,21,23,23,25,25,27,28,28,29,30,31,32,33,35,36,37,37,38,40,41,41,42,43,45,45,47,48}
{5,12,48,31,0,13,41,42,11,27,24,28,2}
{43,46}
Returns: 3
{0,1,2,2,4,5,6,7,8,8,9,10,11,12,13,14,16,16,18,18,20,21,21,23,24,24,26,27,27,28,30,30,32,32,34,34,35,36,38,38,39,41,41,42,44,44,45,46,48}
{2}
{47}
Returns: 30
{0,0,1,2,3,5,6,6,8,9,10,11,12,13,14,15,16,16,18,18,20,21,22,22,23,25,25,26,28,29,30,31,32,33,33,35,36,36,38,38,39,41,42,43,43,44,45,46,47}
{0}
{49}
Returns: 38
{0,0,2,2,3,5,6,7,7,8,9,10,12,13,14,14,16,16,17,18,20,20,22,23,24,24,26,27,28,28,29,30,31,32,33,34,35,36,37,38,40,40,42,43,44,45,46,46,48}
{0}
{47}
Returns: 32
{0,0,2,2,4,4,5,6,8,9,9,11,12,13,14,14,16,16,18,19,19,21,21,22,24,25,26,27,27,28,30,30,32,32,33,34,36,36,37,39,39,41,41,42,44,44,45,47,48}
{0}
{47}
Returns: 31
{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48}
{49}
{0}
Returns: 49
{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48}
{0}
{49}
Returns: 49
{0,0,1,3,3,4,5,6,8,9,9,11,12,12,14,15,15,17,17,19,19,20,21,22,23,25,26,27,27,28,30,30,32,33,34,34,36,37,38,38,39,40,42,42,44,45,45,47,47}
{0}
{47}
Returns: 31
{0 }
{0 }
{1 }
Returns: 1
{0, 0, 0, 3, 4, 1 }
{2 }
{6 }
Returns: 5
{0, 1, 2, 3, 4, 3, 6, 7, 8, 9, 10, 11, 12, 13, 14, 1, 16, 17, 18, 17, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48 }
{2, 16 }
{0 }
Returns: 13
{0, 1, 2, 3 }
{0, 4 }
{1 }
Returns: 1
{0, 1, 2, 3, 4, 5, 6, 7 }
{0, 6 }
{1 }
Returns: 1
{0, 1, 2 }
{0, 3 }
{1 }
Returns: 1
{0, 0, 1, 1, 4, 0, 0, 2, 2, 5, 7 }
{1, 11 }
{0, 2, 3, 7 }
Returns: 1
{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 11, 15, 3, 17, 0, 19, 20 }
{5, 4 }
{16, 18 }
Returns: 6
{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }
{0, 8 }
{7, 9 }
Returns: 1
{0, 1, 2, 3, 4, 0, 6 }
{4, 7 }
{1, 6 }
Returns: 1
{0, 1, 2 }
{0, 3 }
{2 }
Returns: 1
{0, 0, 0, 3, 4, 2 }
{1 }
{6 }
Returns: 5
{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48 }
{0 }
{49 }
Returns: 49
{0, 1, 2, 0, 4, 5, 0, 7, 8, 0, 10, 11 }
{0 }
{2, 5, 8, 11 }
Returns: 2
{0, 0, 0, 3, 4, 5, 6, 7, 8, 9 }
{0, 10 }
{1, 2, 3 }
Returns: 1
{0, 1, 2, 3, 4 }
{0, 5 }
{1 }
Returns: 1
{0, 1, 2, 3, 4, 5 }
{0, 4 }
{1, 5 }
Returns: 1
{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 1, 48 }
{0, 47 }
{49, 45 }
Returns: 2
{0, 1, 2, 3, 4 }
{2 }
{5 }
Returns: 5
{0, 1, 2, 2, 0, 2, 2, 6, 8, 9, 6, 5, 11, 6, 12, 7, 6, 7, 8, 12, 18, 7, 7, 5, 10, 25, 6, 2, 1, 25, 6, 18, 11, 21, 15, 9, 31, 27, 27, 21, 11, 14, 3, 12, 20, 37, 11, 43, 34 }
{13, 18, 33, 43, 39 }
{44, 29, 25, 19, 20 }
Returns: 4