| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 1 초 | 2048 MB | 30 | 21 | 11 | 57.895% |
Evil Arglwyddytywyllwch loves problems where something needs to be summed. Such problems usually have short statements and lack long legends about good and evil characters. He also doesn't like it when to solve a problem, you need to write a thousand numbers in the code. Therefore, he suggested the following problem to you.
Given non-negative integers $n$, $m$, $k$, $l$. Calculate
$$ \sum_{a = 0}^{n} \sum_{b = 0}^{n} \sum_{c = 0}^{m} \sum_{d = 0}^{m} \sum_{e = 0}^{k} \sum_{f = 0}^{l} {(ab + cd + 1) ^ {e \oplus f}} \bmod 998\,244\,353, $$
where $\oplus$ is the operation of bitwise exclusive OR (that is, XOR).
The first line contains a single integer $T$ ($1 \leq T \leq 100$), denoting the number of test cases.
Each of the $T$ following lines contains four integers $n$, $m$, $k$, $l$ ($0 \leq n, m \leq 300$, $k, l \geq 0$, $k^2 + l^2 \leq 2023$), describing the test case.
It is guaranteed that the sum of the values $n^2 + m^2$ for all test cases does not exceed $2 \cdot 10^5$.
For each test case, print a single integer: the value of the sum modulo $998\,244\,353$.
6 0 0 0 0 0 0 3 6 1 0 1 0 1 1 1 1 25 2 20 23 99 82 44 3
1 28 9 80 950955110 140425437