#P15713. [JAG 2023 Summer Camp #2] Empty Quartz
[JAG 2023 Summer Camp #2] Empty Quartz
Description
crystals are aligned in a row. However, some of them may be phantoms.
Jun counted the number of real crystals from -th to -th (closed interval) for every pair and recorded their evenness.
His records show that there were intervals that contained an odd number of real crystals. How many possible crystal alignments are there? Answer the remainder divided by .
Note that if there is such that the -th crystal from the left is real on one side and phantom on the other, the two alignments are considered different.
You are given of the above problems. Answer each of them.
Input Format
$$\begin{aligned} &T \\ &N_1 \ K_1 \\ &\vdots \\ &N_T \ K_T \end{aligned}$$The input satisfies the following constraints.
- All inputs consist of integers.
Output Format
Output lines. On the line , answer the problem when . Add a new line at the end of each line.
1
3 4
3
5
5 9
6 10
10 24
10 25
100000 75915540
10
21
165
0
651081880
Hint
If we denote a real crystal as and an phantom as , the following three alignments satisfy the condition at Sample Input 1.
京公网安备 11011102002149号