#include using namespace std; int n; int v[1000]; int memo[2][1000]; int solve(bool f,int idx){ if(idx==n){ return 0; } if(memo[f][idx]!=-1){ return memo[f][idx]; } int ret=-1; if(f==false){ ret=max(ret,max(solve(f,idx+1),solve(true,idx+1)+v[idx])); }else{ ret=max(ret,solve(false,idx+1)); } return ret; } int main(){ cin>>n; for(int i=0;i>v[i]; memset(memo,-1,sizeof(memo)); cout<