#P3791. 普通数学题

    ID: 2729 远端评测题 1000ms 125MiB 尝试: 0 已通过: 0 难度: 9 上传者: 标签>洛谷原创O2优化枚举,暴力进制前缀和洛谷月赛

普通数学题

Description

Given three integers n,m,xn, m, x, compute $\sum_{i=0}^n \sum_{j=0}^m d(i \operatorname{xor} j \operatorname{xor} x)$, where xor\operatorname{xor} denotes bitwise XOR and d(x)d(x) denotes the number of divisors of xx.

Since the answer can be large, output the result modulo 998244353998244353.

Input Format

One line with three integers n,m,xn, m, x.

Output Format

Output the answer modulo 998244353998244353.

0 2 233
14
123 234 345
205761

Hint

For 20%20\% of the testdata, n,m,x2000n, m, x \leq 2000.

For 50%50\% of the testdata, n,m,x106n, m, x \leq 10^6.

For 80%80\% of the testdata, n,m,x108n, m, x \leq 10^8.

For 100%100\% of the testdata, 1n,m,x10101 \leq n, m, x \leq 10^{10}.

Translated by ChatGPT 5