func_code_string: #include <bits/stdc++.h>   int a[1010], b[1010];   int n, k, inf = 0x0f0f0f0f;   int test(int cur) {     int i, ans = 0;     if (cur <= 0) return inf;     for (i = 0; i < n; i++) {       if (a[i] != cur) ans++;       cur += k;     }     return ans;   }   int main() {     int i, j, cur;     while (~scanf( %d%d , &n, &k)) {       for (i = 0; i < n; i++) scanf( %d , &a[i]);       for (i = 0; i < n; i++) b[i] = test(a[i] - i * k);       for (i = 1, j = 0; i < n; i++)         if (b[i] < b[j]) j = i;       printf( %d n , b[j]);       cur = a[j] - k * j;       for (i = 0; i < n; i++) {         if (a[i] != cur) {           if (a[i] < cur)             printf( + %d %d n , i + 1, cur - a[i]);           else             printf( - %d %d n , i + 1, a[i] - cur);         }         cur += k;       }     }     return 0;   }   