Problem L. Sequence
时间限制 3000 ms
内存限制 256 MB
Tom gets an integer sequence $a$ indexed from $1$ with length $n$ from Jerry and he wants to apply $k$ kinds of operations to this sequence.
For a type $k$ operation, he calculates $b_i = \sum_{j = i - k \cdot x} a_j (0 \leq x, 1\leq j \leq i)$ for every $i$ ranged from $1$ to $n$ and then replaces each $a_i$ with $b_i\bmod 998244353$.
He wonders what the final sequence looks like after $m$ operations.
输入数据
输出数据
For each test case, output one line containing an integer $ans$.
$ans = (1 \cdot a_1) \oplus (2 \cdot a_2) \oplus...\oplus(n \cdot a_n)$, $a_i$ is the $i$th element of sequence $a$ after $m$ operations, $\oplus$ means bitwise exclusive OR operation.
样例输入
复制
2
5 2
2 4 2 1 1
1 1
5 2
3 2 2 4 1
2 2
样例输出
$ Mathjax font initiator $