#include using namespace std; int main() { int n; cin>>n; vector v(n); for(int i=0; i>v[i]; vector dp(n+1); dp[1]=v[0]; for(int i=1; i