CF177D2 Encrypting Messages
题目描述
给定一个长度为 $n$ 的序列 $a$ 和一个长度为 $m$ 的序列 $b$ 以及一个模数 $c$ (保证 $m \le n$ ),你需要对它们进行 $n-m+1$ 次操作。
对于第 $i$ 次操作,将 $a_i \sim a_{i+m-1}$ 对应的加上 $b_1 \sim b_m$ (即 $a_i=a_i+b_1,a_{i+1}=a_{i+1}+b_2$,以此类推 。)
最后,你需要输出操作完成后 $a$ 序列对于 $c$ 取模的结果。
输入格式
第一行输入 $n,m,c$
下面两行分别是序列 $a$ 与 $b$。
输出格式
输出一行 $n$ 个整数,表示操作完成后 $a$ 序列对于 $c$ 取模的结果。
$\mathtt{Translated\ by} $ @[$\mathtt{wkjwkj}$](/user/240405)
说明/提示
In the first sample the encryption is performed in two steps: after the first step $ a=(0,0,0,1) $ (remember that the calculations are performed modulo 2), after the second step $ a=(0,1,1,0) $ , and that is the answer.