TopCoder

User's AC Ratio

NaN% (0/0)

Submission's AC Ratio

NaN% (0/0)

Tags

Description

Given two set A and B, each containing various positive integers. You are on the number, line starting from zero. On each odd jumps (the first, third, fifth ...) you can choose a number from set A and jump that distance to your right; on each even jumps (the second, fourth, sixth ...) you can choose a number from set B and jump that distance to your left.

Now given the set A, B, is every integer point on the number line reachable?

Input Format

The first line contains a number T, indicating the number of testcases.

Each testcase first gives the sets A and B on two lines (First A then B). The first number in the line indicates the number of elements in the set, then follows each of the elements. There will not be duplicate elements in a set.

T <= 100

1 <= number of elements in A or B <= 50000

Each element is no larger than 100000000.

Output Format

For each testcase, if all points can be reached, output "Win" in a line, otherwise output "Lose".

Sample Input 1

2
2  8 5
3  6 9 3
3  6 9 12
4  3 9 15 18

Sample Output 1

Win
Lose

Hints

Problem Source

Migrated from old NTUJ.

petr

Subtasks

No. Testdata Range Score

Testdata and Limits

No. Time Limit (ms) Memory Limit (VSS, KiB) Output Limit (KiB) Subtasks
0 6000 65536 200