#include using namespace std; #define rep(i,n) for(int i=0;i<(int)(n);i++) #define ALL(v) v.begin(),v.end() typedef long long ll; template using V=vector; template using VV=V>; int main(){ ios::sync_with_stdio(false); std::cin.tie(nullptr); int t; cin>>t; while(t--){ int n; cin>>n; V A(n); ll sum=0; rep(i,n){ cin>>A[i]; sum+=A[i]; } sort(ALL(A)); if(n==1) cout<<1<<'\n'; else{ if(A[n-1]<=sum-A[n-1]+1) cout<