func_code_string: #include <bits/stdc++.h>   using namespace std;   const int MAXN = 1100;   int a[MAXN];   int main() {     int n, k;     while (scanf( %d%d , &n, &k) != EOF) {       for (int i = 0; i < n; i++) scanf( %d , &a[i]);       int res = 0;       int sum = (1 << 29);       for (int i = 0; i < n; i++) {         int tmp = 0, flag = true;         for (int j = 0; j < n; j++)           if (a[j] != a[i] + (j - i) * k) {             tmp++;             if (a[i] + (j - i) * k <= 0) flag = false;           }         if (flag && tmp < sum) sum = tmp, res = i;       }       printf( %d n , sum);       if (sum) {         for (int i = 0; i < n; i++) {           int tmp = a[res] + (i - res) * k;           if (a[i] < tmp)             printf( + %d %d n , i + 1, tmp - a[i]);           else if (a[i] > tmp)             printf( - %d %d n , i + 1, a[i] - tmp);         }       }     }     return 0;   }   