#P7979. 「Stoi2033」世界未末日 加强版
「Stoi2033」世界未末日 加强版
Description
Vinsta and Stella have piles of stones, and the -th pile has stones.
They agree to take turns starting from Vinsta. In each move, one may choose at least pile and at most piles. For the -th pile, one may choose two real numbers such that:
Then discard stones from the -th pile, i.e., . The player who cannot make a move loses. They want to know whether Vinsta has a winning strategy.
Input Format
The first line contains a positive integer , the number of test cases.
Then follow test cases. For each test case, the first line contains three positive integers , where .
The second line contains positive integers , representing the initial number of stones in the -th pile.
Output Format
For each test case, output one line. If there is a winning strategy, output YES, otherwise output NO.
2
7 1 13
2 3 4 5 7 10 11
8 1 13
2 3 4 5 7 10 11 13
YES
NO
1
7 2 100
19 26 8 17 11 45 14
YES
Hint
For of the testdata, , , .
Translated by ChatGPT 5
京公网安备 11011102002149号