XX Open Cup, Grand Prix of Tokyo |
---|
Finished |
You are given $$$K$$$ distinct nonnegative integers $$$A_1,A_2,\cdots,A_K$$$. Count the number of sequences of $$$N$$$ nonnegative integers $$$a_1,a_2,\cdots,a_N$$$ that satisfies all of the following conditions, modulo **$$$2$$$**.
Note that there are $$$T$$$ tests in one input file.
Input is given from Standard Input in the following format:
$$$T$$$
Description of the $$$1$$$-st test
Description of the $$$2$$$-nd test
$$$\vdots$$$
Description of the $$$T$$$-th test
The description of each test is in the following format:
$$$N$$$ $$$S$$$ $$$K$$$
$$$A_1$$$ $$$A_2$$$ $$$\cdots$$$ $$$A_K$$$
Constraints:
For each test, print the count modulo $$$2$$$.
2 5 10 3 1 2 3 1000000000000000000 25453321771239381 10 0 1683 21728 31623 35054 37834 39329 56842 68603 74742
1 0
In the first test, there are a total of $$$51$$$ sequences that satisfy conditions.
Name |
---|