A game is being played where the player (you) must guess the number the other player is thinking of. To do this, there is a set of 60 cards that contain an infinite list of numbers; the player who thinks of a number must choose all the cards where their number appears. And, to make the game fair, the number they are thinking of must be positive and less than or equal to $$$10^{18}$$$.
Below is the content of the first 5 cards:
And so on until reaching card number 60.
The game is played in $$$q$$$ rounds. In each round, a list of $$$k$$$ numbers is given, indicating all the cards that contain the number the other player is thinking of. You must guess the secret number in each round.
The first line contains an integer $$$q$$$ ($$$1 \leq q \leq 1000$$$), indicating the number of rounds to be played.
The next $$$q$$$ lines start with an integer $$$k$$$ ($$$1 \leq k \leq 60$$$), indicating the number of cards in the round. Then, $$$k$$$ integers $$$a_i$$$ ($$$1 \leq a_i \leq 60$$$) separated by a space are presented, indicating the card number $$$i$$$. It is guaranteed that there will be no repeated cards in the same round.
For each of the $$$q$$$ rounds, print one line with the secret number the other player was thinking of.
It is guaranteed that the answer will always be a number in the range $$$[1, 10^{18}]$$$.
4 4 1 2 3 4 2 1 2 3 1 3 4 7 3 6 9 10 22 29 45
15 3 13 17592456577828
| Название |
|---|


