func_code_string: #include <bits/stdc++.h>   using namespace std;   int Read() {     char c;     while (c = getchar(), (c !=  - ) && (c <  0  || c >  9 ))       ;     bool neg = (c ==  - );     int ret = (neg ? 0 : c - 48);     while (c = getchar(), c >=  0  && c <=  9 ) ret = ret * 10 + c - 48;     return neg ? -ret : ret;   }   const int MAXN = 1005;   int N, n, a[MAXN];   pair<int, int> ans[MAXN * MAXN];   void init() {     scanf( %d , &N);     for (int i = 1; i <= N; i++) a[i] = Read(), n += (a[i] > 0);   }   void work() {     if (n < 2) {       puts( -1 );       return;     } else       n = 0;     int B = 1, C = 2;     for (int i = 3; i <= N; i++)       for (int A = i;;) {         if (a[B] < a[A]) swap(A, B);         if (a[C] < a[B]) swap(C, B);         if (a[B] < a[A]) swap(A, B);         if (!a[A]) break;         for (int j = a[B] / a[A]; j; j >>= 1)           if (j & 1)             ans[++n] = make_pair(A, B), a[B] -= a[A], a[A] <<= 1;           else             ans[++n] = make_pair(A, C), a[C] -= a[A], a[A] <<= 1;       }     printf( %d n , n);     for (int i = 1; i <= n; i++) printf( %d %d n , ans[i].first, ans[i].second);   }   int main() {     init();     work();     return 0;   }   