func_code_string: #include <bits/stdc++.h>   using namespace std;   inline int rd() {     register int ans = 0, flag = 1;     register char c = getchar();     for (; c >  9  || c <  0 ; c = getchar())       if (c ==  - ) flag = -1;     for (; c >=  0  && c <=  9 ; c = getchar()) ans = ans * 10 -  0  + c;     return ans * flag;   }   const int MAXN = 1e5 + 10;   int a[MAXN];   int ans[MAXN];   int tmp[MAXN];   int _[20][MAXN];   void dfs(int now, int n) {     if (n < 2 && _[now][1] == 0) {       if (tmp[0] < ans[0]) {         ans[0] = tmp[0];         for (register int i = 1; i <= tmp[0]; ++i) {           ans[i] = tmp[i];         }       }       return;     }     if (now > 18 || tmp[0] >= ans[0]) {       return;     }     for (register int I = 1; I <= n; ++I) {       if (_[now][I] & 1) {         for (register int i = 1; i <= n; ++i) {           _[now + 1][i] = (_[now][i] - (_[now][i] & 1)) >> 1;         }         tmp[++tmp[0]] = (1 << now);         register int nn =             unique(_[now + 1] + 1, _[now + 1] + n + 1) - _[now + 1] - 1;         dfs(now + 1, nn);         --tmp[0];         for (register int i = 1; i <= n; ++i) {           _[now + 1][i] = (_[now][i] + (_[now][i] & 1)) >> 1;         }         tmp[++tmp[0]] = -(1 << now);         nn = unique(_[now + 1] + 1, _[now + 1] + n + 1) - _[now + 1] - 1;         dfs(now + 1, nn);         --tmp[0];         return;       }     }     for (register int i = 1; i <= n; ++i) {       _[now + 1][i] = _[now][i] >> 1;     }     n = unique(_[now + 1] + 1, _[now + 1] + n + 1) - _[now + 1] - 1;     dfs(now + 1, n);   }   int main() {     register int n = rd();     for (register int i = 1; i <= n; ++i) {       a[i] = rd();     }     sort(a + 1, a + n + 1);     n = unique(a + 1, a + n + 1) - a - 1;     ans[0] = 0x3f3f3f3f;     for (register int i = 1; i <= n; ++i) {       _[0][i] = a[i];     }     dfs(0, n);     printf( %d n , ans[0]);     for (register int i = 1; i <= ans[0]; ++i) {       printf( %d  , ans[i]);     }     printf(  n );     return 0;   }   