http://www.51nod.com/Challenge/Problem.html#problemId=1023 #include<bits/stdc++.h> using namespace std; const int maxn = 5e4+1; long long a[maxn], b[maxn], tot, ans; void combine(int x) { long long i, d, temp; temp = b[x] + b[x+1]; for(i = x+1; i <= tot-1; i++) { b[i...