F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

Lunch

Time Limit: 6000/3000 MS (Java/Others)    Memory Limit: 524288/524288 K (Java/Others)
Total Submission(s): 4140    Accepted Submission(s): 1016


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
3 2 4 9 2 2 3 3 3 9 27
 

Sample Output
W L L
 

Source
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-04-20 10:51:39, Gzip enabled