0_0_28916981_9277.cpp: In function 'int main()':
0_0_28916981_9277.cpp:4:146: error: expected '}' at end of input
int main(void){ int T;cin>>T; while(T--) { int n; cin>>n; for(int i=0;i<n;i++) cin>>b[i]; //n = unique(b,b+n) - b;// È¥ÖØÓÅÐã²Ù×÷ sort(b,b+n); int sum=0; int flag=1; for(int i=1;i<n-1;i++) { sum+=(b[n-1]-b[i]); if(sum>=b[0]) {flag=0;break;} } sum+=b[n-1]-b[0]; if(!flag) cout<<"-1"<<endl; else cout<<sum<<endl; }}
^
0_0_28916981_9277.cpp:4:146: error: expected '}' at end of input
|