func_code_string: #include <bits/stdc++.h>   using namespace std;   int sum[100010], ans[100010];   int data[100010];   bool sign[100010];   int main() {     int n, m, c;     while (scanf(  %d %d %d , &n, &m, &c) == 3) {       for (int i = 1; i <= n; i++) {         scanf(  %d , &ans[i]);       }       for (int i = 1; i <= m; i++) {         scanf(  %d , &sum[i]);         sum[i] += sum[i - 1];       }       memset(sign, 0, sizeof(sign));       for (int i = 1; i <= m && i <= n; i++) {         if (i + m - 1 <= n) {           ans[i] += sum[i];           sign[i] = 1;         } else {           ans[i] += sum[i] - sum[i + m - 1 - n];           sign[i] = 1;         }       }       for (int i = n; n - i + 1 <= m && i >= 1 && !sign[i]; i--) {         if (i - m + 1 >= 1) {           ans[i] += sum[m] - sum[m + i - n - 1];           sign[i] = 1;         } else {           ans[i] += sum[m] - sum[m + i - n - 1] - (sum[m] - sum[i]);           sign[i] = 1;         }       }       for (int i = 1; i <= n; i++) {         if (sign[i]) continue;         ans[i] += sum[m];       }       for (int i = 1; i < n; i++) {         printf( %d  , ans[i] % c);       }       printf( %d n , ans[n] % c);     }     return 0;   }   