#include <iostream>
#include <vector>
#include <limits>
#include <algorithm>

using namespace std;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(0);

    int N;
    cin >> N;
    // for sum of [a, b), just calc sum[a]-sum[b]
    vector<long long> as(N);
    vector<long long> sum(N+1, 0);
    for(int i = 0; i < N; ++i) {
        cin >> as[i];
    }
    for(int i = N-1; i >= 0; --i) {
        sum[i] = sum[i+1] + as[i];
    }

    // dp[始点][終点] = [始点, 終点)を一つにしたとき，[0,終点)での最長増加列長
    vector<vector<int> > dp(N+1, vector<int>(N+1, numeric_limits<int>::min())), prev(N+1, vector<int>(N+1, numeric_limits<int>::min()));
    for(int right = 1; right <= N; ++right) {
        dp[0][right] = 1;
    }
    for(int cur = 1; cur < N; ++cur) {
        // 点curから始まる系列[cur, next)を考える．
        vector<pair<long long,int> > nums;
        // 点curから始まる系列を与え得る直前の状態を列挙する．
        for(int prev_i = 0; prev_i < cur; ++prev_i) {
            nums.push_back(make_pair(sum[prev_i] - sum[cur], -prev_i));
        }
        // 点curから始まる系列が到達し得る状態を列挙する．
        for(int right = cur+1; right <= N; ++right) {
            nums.push_back(make_pair(sum[cur] - sum[right], -right));
        }
        sort(nums.begin(), nums.end());
        int best = numeric_limits<int>::min();
        int best_prev = -1;
        for(vector<pair<long long,int> >::iterator it = nums.begin(); it != nums.end(); ++it) {
            int pos = -it->second;
            if(pos < cur) {
                if(best < dp[pos][cur]) {
                    // これより先，[pos,cur)から接続するのが最も効率が良い．
                    best = dp[pos][cur];
                    best_prev = pos;
                }
            } else if(pos > cur) {
                if(dp[cur][pos] < best+1) {
                    dp[cur][pos] = best+1;
                    prev[cur][pos] = best_prev;
                    //cout << cur << ' ' << pos << ' ' << dp[cur][pos] << endl;
                }
            }
        }
    }
    {
        // Nを終点とするDP表から最良の始点を選ぶ．
        int cur = -1;
        int best = 0;
        for(int left = 0; left < N; ++left) {
            if(dp[left][N] > best) {
                best = dp[left][N];
                cur = left;
            }
        }
        // 経路復元
        vector<int> checkpoint;
        int prev_cur = N;
        while(cur > 0) {
            checkpoint.push_back(cur);
            int next = prev[cur][prev_cur];
            prev_cur = cur;
            cur = next;
        }
        sort(checkpoint.begin(), checkpoint.end());
        cout << checkpoint.size()+1 << endl;
        for(vector<int>::iterator it = checkpoint.begin(); it != checkpoint.end(); ++it) {
            if(it != checkpoint.begin()) cout << ' ';
            cout << *it;
        }
        cout << endl;
    }
    return 0;
}
### Prompt

Construct a cpp code solution to the problem outlined:

Time passed and Taro became a high school student. Under the influence of my older brother who was a college student, I began to be interested in computer science. Taro read through computer science textbooks and learned that there was a famous problem called the "longest increase subsequence problem." Taro understood this problem, but was wondering if he could create a similar problem himself. Therefore, Taro created the following problem as a result of trial and error.

* There is a sequence A consisting of n integers
* Decompose the sequence A into m sequences with m-1 delimiters. In addition, each sequence after decomposition must always include one or more numbers.
* If the m numbers created by adding all the integers in each of these m sequences are arranged in the order of the original sequence, it becomes a strict increasing sequence (that is, the resulting sequence is Bi <Bi + 1). I want to do it.
* The goal is to maximize the length m of the final sequence B.



For example, consider the case where the sequence A is {5, -4,10, -3,8}.
Prepare a sequence C that represents the position of the delimiter, and set C = {2,4}.
At this time, the sequence A is divided into the parts (5, -4), (10, -3), (8), and when these interiors are added together, they become 1,7,8, respectively, and the resulting sequence B is {1, 7,8}.

<image>

Taro named this problem the "longest increase subsequence problem" and also considered an algorithm to solve it.
And I contacted you as a member of society to check it. Your job is to create a program to solve the problems created by Taro who has grown up.
Since it is my job to check, it also outputs the position of the m-1 delimiter. In addition, there may be multiple such delimiters for the optimum m, but if this m is output correctly, one of the possible ones should be output.

Constraints

> 1 ≤ n ≤ 4000
> | Ai | ≤ 108
>

* For the integer k, | k | represents the absolute value of k

Input

N + 1 integers are given, separated by line breaks.

> n
> A1
> A2
> ...
> An
>

* n represents the length of the given sequence A
* Ai represents the i-th element of the sequence A.

Output

> m
> C1 C2 .. Cm-1
>

* The first line outputs one integer m. m represents the length of the final sequence B. The second line outputs m-1 integer Ci separated by blanks. Ci represents the i-th delimiter when the sequence A is appropriately divided into m parts. See the figure for the definition of the delimiter. Note that 1 ≤ Ci <n is satisfied. The m-1 integer sequence C in the second row must be arranged in ascending order. Therefore, if i <j, then Ci <Cj holds.


* If m = 1, the second line will be blank.
* When the sequence B is generated from the sequence A according to the sequence C, when the sequence B is not an increasing sequence (that is, when i (1 ≤ i <m) such that Bi ≥ Bi + 1 exists), it becomes WrongAnswer.

Examples

Input

3
1
2
4


Output

3
1 2


Input

3
2
2
2


Output

2
1


Input

3
4
2
1


Output

1
(空行)

### Response

```cpp
#include <iostream>
#include <vector>
#include <limits>
#include <algorithm>

using namespace std;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(0);

    int N;
    cin >> N;
    // for sum of [a, b), just calc sum[a]-sum[b]
    vector<long long> as(N);
    vector<long long> sum(N+1, 0);
    for(int i = 0; i < N; ++i) {
        cin >> as[i];
    }
    for(int i = N-1; i >= 0; --i) {
        sum[i] = sum[i+1] + as[i];
    }

    // dp[始点][終点] = [始点, 終点)を一つにしたとき，[0,終点)での最長増加列長
    vector<vector<int> > dp(N+1, vector<int>(N+1, numeric_limits<int>::min())), prev(N+1, vector<int>(N+1, numeric_limits<int>::min()));
    for(int right = 1; right <= N; ++right) {
        dp[0][right] = 1;
    }
    for(int cur = 1; cur < N; ++cur) {
        // 点curから始まる系列[cur, next)を考える．
        vector<pair<long long,int> > nums;
        // 点curから始まる系列を与え得る直前の状態を列挙する．
        for(int prev_i = 0; prev_i < cur; ++prev_i) {
            nums.push_back(make_pair(sum[prev_i] - sum[cur], -prev_i));
        }
        // 点curから始まる系列が到達し得る状態を列挙する．
        for(int right = cur+1; right <= N; ++right) {
            nums.push_back(make_pair(sum[cur] - sum[right], -right));
        }
        sort(nums.begin(), nums.end());
        int best = numeric_limits<int>::min();
        int best_prev = -1;
        for(vector<pair<long long,int> >::iterator it = nums.begin(); it != nums.end(); ++it) {
            int pos = -it->second;
            if(pos < cur) {
                if(best < dp[pos][cur]) {
                    // これより先，[pos,cur)から接続するのが最も効率が良い．
                    best = dp[pos][cur];
                    best_prev = pos;
                }
            } else if(pos > cur) {
                if(dp[cur][pos] < best+1) {
                    dp[cur][pos] = best+1;
                    prev[cur][pos] = best_prev;
                    //cout << cur << ' ' << pos << ' ' << dp[cur][pos] << endl;
                }
            }
        }
    }
    {
        // Nを終点とするDP表から最良の始点を選ぶ．
        int cur = -1;
        int best = 0;
        for(int left = 0; left < N; ++left) {
            if(dp[left][N] > best) {
                best = dp[left][N];
                cur = left;
            }
        }
        // 経路復元
        vector<int> checkpoint;
        int prev_cur = N;
        while(cur > 0) {
            checkpoint.push_back(cur);
            int next = prev[cur][prev_cur];
            prev_cur = cur;
            cur = next;
        }
        sort(checkpoint.begin(), checkpoint.end());
        cout << checkpoint.size()+1 << endl;
        for(vector<int>::iterator it = checkpoint.begin(); it != checkpoint.end(); ++it) {
            if(it != checkpoint.begin()) cout << ' ';
            cout << *it;
        }
        cout << endl;
    }
    return 0;
}
```