#include #include using namespace std; int main(void){ int n, v[1001]; cin >> n; for(int i=0; i> v[i]; } if( n == 1 ){ cout << v[0] << endl; return 0; }else if(n==2){ if(v[0] < v[1]){ cout << v[1] << endl; }else{ cout << v[0] << endl; } return 0; } int dp[1001]; dp[0] = v[0]; dp[1] = v[1]; dp[2] = v[0] + v[2]; for(int i=3; i