#P11077. 「FSLOI Round I」石子
「FSLOI Round I」石子
Description
Frank and Louis are playing a game with piles of stones, where the -th pile has stones. Denote the average of sequence as .
Before the game starts, a positive integer not greater than is given. Frank and Louis take turns making the following moves with Frank going first:
-
Choose the -th and the -th piles of stones satisfying
-
Take out stones from the -th pile and put them into the -th pile of stones.
The player who is unable to make a move loses.
Determine who will win if both players play optimally.
Input Format
Each test contains multiple test cases.
The first line of the input contains a single integer , the number of test cases. The description of test cases follows.
The first line of each test case contains two integers and .
The second line of each test case contains integers: .
Output Format
For each test case, output F if Frank wins, L if Louis wins, and Draw if the game will never end.
1
5 2
1 5 7 9 13
L
2
6 3
4 7 5 3 1 16
7 2
2 6 4 8 12 4 6
Draw
L
Hint
Example Explanation
In the first example, is initially , and the average value of the sequence is .
One possible game process follows:
-
Frank chooses , and becomes .
-
Louis chooses , and becomes .
-
Frank chooses , and becomes .
-
Louis chooses , and becomes .
-
Frank is unable to make a move, so Louis wins.
Constraints
Subtasks are used in this problem.
For all tests, it is guaranteed that:
- is an integer.
| Subtask Id | Score | Special Property |
|---|---|---|
| - |
Special Property A: .
京公网安备 11011102002149号