|
||||||||||
Bragging DiceTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/524288 K (Java/Others)Total Submission(s): 821 Accepted Submission(s): 305 Problem Description In the mysterious accient East, there is an ancient dice game - "bragging". Now YahAHa and Peanut is playing bragging. The rules of the game are as follows: There are $2$ players in one game. Each player has $n$ dices in the cup. Both players roll the dice once. Players play in turns. YahAHa start. In the first turn, YahAHa can claim "there are $x(x\geq 1)$ dices with $y(1\leq y\leq 6)$ points in the 2 cups". Then Peanut has $2$ choices. 1. Challenge YahAHa. If anyone challenges, the game is over . Each player opens its cup. If indeed there are $x$ dices with $y$ points in the cups, YahAHa wins, otherwise Peanut wins. 2. Continue to claim, but can only claim "there are $x_1$ $(x_1>x)$ dices with $y_1(1\leq y_1\leq 6)$ points in the cups" or "there are $x_2$ $(x_2=x)$ dices with $y_2$ $(y_2 > y)$ points in the cups". After Peanut claimed, YahAHa continued to choose whether to challenge or claim. Both players take turns until someone challenges, then the game is over. To make the game more interesting, here are some special rules. 1. If no one has claimed that "there are $x$ dices with $1$ point in the cups", the dice with $1$ point can be regarded as any points of dice. 2. If all dices in one cup has the same points, it's considered there is an extra dice with the same points. For example, if there are $5$ dices and $5$ dices are all with $6$ points, it's considered there are $6$ dices with $6$ points. 3. If each dice in one cup has different points, it's considered "there are $0$ dice with any points in the cup". For example, if there are $5$ dices,their points are $1$ point, $2$ points, $3$ points, $4$ points and $5$ points. It's considered "there are $0$ dice with $1$ point in the cup", "there are $0$ dice with $2$ point in the cup", ... , "there are $0$ dice with $5$ point in the cup". If there is conflict in these three rules, please consider the third special rule first. YahAHa and Peanut don't like stupid game of chance, so they want to play this game while knowing the points of every dices in the 2 cups. Given you the points of all dices they roll. YahAHa wants to find out who will win the game if both of them play the game optimally. Input Each test contains multiple test cases. The first line contains the number of test cases $(1 \le T \le 30)$. Description of the test cases follows. The first line of the input contains only one integers $n$ $(2\le n \le 2\times 10^5)$ indicating the number of dices. The next line contains $n$ integers $a_1, a_2, \cdots, a_n$. The $i$-th integer $a_i$ indicating the points of the $i$-th dice from YahAHa. The next line contains $n$ integers $b_1, b_2, \cdots, b_n$. The $i$-th integer $b_i$ indicating the points of the $i$-th dice from Peanut. Output For each test case: If YahAHa wins, print "Win!" in one line; If Peanut wins, print "Just a game of chance." in one line. Sample Input
Sample Output
Source | ||||||||||
|