|
||||||||||
LunchTime Limit: 6000/3000 MS (Java/Others) Memory Limit: 524288/524288 K (Java/Others)Total Submission(s): 4378 Accepted Submission(s): 1051 Problem Description Now it's time for lunch. Today's menu is chocolate! Though every baby likes chocolate, the appetites of babies are little. After lunch, there are still $n$ pieces of chocolate remained: The length of the $i$th piece is $l_i$. Using the remained chocolate, Baby Volcano is going to play a game with his teacher, Mr. Sprague. The rule of the game is quite simple. Two player plays in turns, and Baby Volcano will play first: 1. In each turn, the player needs to select one piece of chocolate. If the length of the selected piece is equal to $1$, the player of this turn will lose immediately. 2. Suppose the length of the selected piece is $l$. Then the player needs to select a positive integer $k$ satisfying $k$ is at least $2$ and $k$ is a factor of $l$. 3. Then the player needs to cut the selected piece into $k$ pieces with length $\frac{l}{k}$. The game continues until one player selects a piece of chocolate with length $1$. Suppose both players plays optimally, your task is to determine whether Baby Volcano will win. Input The first line contains single integer $t (1 \leq t \leq 2 * 10^4)$, the number of testcases. For each testcase, the first line contains a single integer $n (1 \leq n \leq 10)$. The second line contains $n$ positive integers $l_i (1 \leq l_i \leq 10^9)$, representing the length of each piece. Output For each testcase, output char 'W' if Baby Volcano will win, otherwise output char 'L'. Sample Input
Sample Output
Source | ||||||||||
|