#include int a[1000], dp[1000], n; int solve(int n) { if (n == 1) return dp[0] = a[0]; if (n == 2) return dp[1] = a[1] > a[0] ? a[1] : a[0]; return dp[n] = solve(n-1)> solve(n-2) + a[n-1] ? solve(n-1) : solve(n-2) + a[n-1]; } int main(void) { int i; scanf("%d", &n); for (i = 0; i