#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; const double PI = 3.14159265358979323846; const double EPS = 1e-12; const int INF = 1<<25; typedef pair P; typedef long long ll; typedef unsigned long long ull; #define N 2000 int dp[N][2]; int main(){ int n; cin>>n; vector d(n); for(int i = 0; i < n; i++) cin>>d[i]; for(int i = 0; i < n; i++){ dp[i+1][0] = max(dp[i][0], dp[i][1]); dp[i+1][1] = max(dp[i][0]+d[i], dp[i][1]); } int res = max(dp[n][0], dp[n][1]), res2 = res; vector r; for(int i = n; i > 0; i--){ if(res==dp[i][1]){ r.push_back(i); res -= d[i-1]; } } reverse(r.begin(), r.end()); cout<