#P4191. [CTSC2010] 性能优化

    ID: 3103 远端评测题 6000ms 250MiB 尝试: 0 已通过: 0 难度: 9 上传者: 标签>2010WC/CTSC/集训队分治素数判断,质数,筛法快速傅里叶变换 FFT

[CTSC2010] 性能优化

Output Format

Output contains nn lines, one number per line. The ii-th line is the value of xC,imod(n+1)x_{C, i} \bmod (n + 1). You should ensure each printed number is between 00 and nn inclusive.

4 1
1 2 3 4
4 3 3 1

2
1
0
2

Hint

There are 1010 test points in total. Constraints:

Test Point nn CC
1 100\leq 100 100\leq 100
2 109\leq 10^9
3 700\leq 700
4
5 104\leq 10^4 =1 = 1
6 105\leq 10^5 =1= 1
7
8 5×105\leq 5 \times 10^5 109\leq 10^9
9
10

In all testdata, aia_i and bib_i do not exceed 10910^9.

Translated by ChatGPT 5