#include #include #define YES cout<<"Yes"<; using vvl = vector>; using vvvl = vector>>; //sample vvvl A(N,vvl(N,vl(N,0))); const ll POW2=1e2,POW5=1e5,POW6=1e6,POW9=1e9,POW12=1e12,POW15=1e15,POW18=1e18; const int iINF = 1<<30; const ll INF = 1LL<<62; const ull UINF = 1LL<<63; const ld ldINF=(ld)POW15; const ll mod=998244353; const ll mod2=1000000007; const ld PI=3.141592653589793238462643; vector dy={-1,0,1,0},dx={0,1,0,-1},dy8={-1,-1,-1,0,0,1,1,1},dx8={-1,0,1,-1,1,-1,0,1}; template using pq = priority_queue>; template using pq_g = priority_queue,greater>; templatebool chmax(T& a, const T& b) { if (a < b) { a = b; return 1; } return 0; } templatebool chmin(T& a, const T& b) { if (b < a) { a = b; return 1; } return 0; } templatevoid vc_unique(vector &v){v.erase(unique(v.begin(),v.end()),v.end());} templatevoid sdebug(string s, T& a){cout<void vdebug(string s, vector &v){ ll W=v.size(); cout<<"--------------------------"<POW15) cout<<"INF "; else if(v[i]<-POW15) cout<<"-INF "; else cout<void vvdebug(string s, vector> &v){ ll H=v.size(); cout<<"--------------------------"<POW15) cout<<"INF "; else if(e<-POW15) cout<<"-INF "; else cout<=0 && n%m!=0) return n/m+1; else return n/m; } ll truncate(ll n, ll m){ if(n<0 && n%m!=0) return n/m-1; else return n/m; } int main() { std::cin.tie(0)->sync_with_stdio(0); ll N;cin>>N; vl V(N);for(ll i=0;i>V[i]; vvl dp(N+1,vl(2,0)); dp[0][0]=0;dp[0][1]=V[0]; for(ll i=1;i