QOJ.ac

QOJ

Time Limit: 1 s Memory Limit: 1024 MB Total points: 100

#8961. 宽表达式

Statistics

Evil Arglwyddytywyllwch 热衷于求和类问题。这类问题通常题目简短,没有关于善恶角色的长篇大论。他也不喜欢那种需要你在代码里写上一千个数才能解决的问题。因此,他向你提出了以下问题。

给定非负整数 $n, m, k, l$。计算 $$\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} \pmod{998\,244\,353}$$ 其中 $\oplus$ 是按位异或(XOR)运算。

输入格式

第一行包含一个整数 $T$ ($1 \le T \le 100$),表示测试用例的数量。

接下来的 $T$ 行,每行包含四个整数 $n, m, k, l$ ($0 \le n, m \le 300, k, l \ge 0, k^2 + l^2 \le 2023$),描述一个测试用例。

保证所有测试用例的 $n^2 + m^2$ 之和不超过 $2 \cdot 10^5$。

输出格式

对于每个测试用例,输出一个整数:求和结果对 $998\,244\,353$ 取模的值。

样例

样例输入 1

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

1
28
9
80
950955110
140425437

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.