#include #include //#include using ll=long long; #define rep(i,a,b) for(int i=a;i; using PD=pair; using PL=pair; int mod1=998244353; int mod2=1000000007; const ll INF = 1000000000000000000; const int big = 2147483647; struct st{ ll x,y,z; st(ll x=0,ll y=0,ll z=0):x(x),y(y),z(z){} bool operator>(const st &a)const{ return x>a.x; } }; PL dp[100010][2]; int main(){ ll n,q,y=0,i,z=0,x=0,d=0,k,L,nk,sum=0,T; ll ans=INF,sum2=0,rs=-1e9,cs=0,l=0,h=0,w=0,r=0,X; ll tmp2=0,flag=0,a=0,b=0,c=0,j=0,m=0,p,S,K; ll N,M=0,R; cin>>N; vectorA(N); rep(i,0,N)cin>>A[i]; rep(i,0,100010)rep(j,0,2){ dp[i][j].fi=-INF; dp[i][j].se=-INF; } dp[0][0].fi=100; dp[0][0].se=100; dp[0][1].fi=100; dp[0][1].se=100; rep(i,0,1<>j)&1)continue; if(dp[i][0].fi+A[j]<=0)continue; bool jud=true; if(dp[i|(1<