# include "bits/stdc++.h"
using namespace std;
using LL = long long;
using ULL = unsigned long long;
const double PI = acos(-1);
template<class T>constexpr T INF() { return ::std::numeric_limits<T>::max(); }
template<class T>constexpr T HINF() { return INF<T>() / 2; }
template <typename T_char>T_char TL(T_char cX) { return tolower(cX); };
template <typename T_char>T_char TU(T_char cX) { return toupper(cX); };
typedef pair<LL, LL> pii;
const int vy[] = { -1, -1, -1, 0, 1, 1, 1, 0 }, vx[] = { -1, 0, 1, 1, 1, 0, -1, -1 };
const int dx[4] = { 0,1,0,-1 }, dy[4] = { 1,0,-1,0 };
int popcnt(unsigned long long n) { int cnt = 0; for (int i = 0; i < 64; i++)if ((n >> i) & 1)cnt++; return cnt; }
int d_sum(LL n) { int ret = 0; while (n > 0) { ret += n % 10; n /= 10; }return ret; }
int d_cnt(LL n) { int ret = 0; while (n > 0) { ret++; n /= 10; }return ret; }
LL gcd(LL a, LL b) { if (b == 0)return a; return gcd(b, a%b); };
LL lcm(LL a, LL b) { LL g = gcd(a, b); return a / g*b; };
# define ALL(qpqpq)           (qpqpq).begin(),(qpqpq).end()
# define UNIQUE(wpwpw)        sort(ALL((wpwpw)));(wpwpw).erase(unique(ALL((wpwpw))),(wpwpw).end())
# define LOWER(epepe)         transform(ALL((epepe)),(epepe).begin(),TL<char>)
# define UPPER(rprpr)         transform(ALL((rprpr)),(rprpr).begin(),TU<char>)
# define FOR(i,tptpt,ypypy)   for(LL i=(tptpt);i<(ypypy);i++)
# define REP(i,upupu)         FOR(i,0,upupu)
# define INIT                 std::ios::sync_with_stdio(false);std::cin.tie(0)

LL a[4320];
LL p = 0;

vector<int> ans;
vector<pair<LL, LL>> nums;
int maxdp[4040];
int dp[4040][4040];
int n;
bool comp(const pair<LL, LL> &x, const pair<LL, LL> &y){
    if(a[x.second] - a[x.first - 1] == a[y.second] - a[y.first - 1]){
        return x > y;
    }
    return a[x.second] - a[x.first - 1] < a[y.second] - a[y.first - 1];
}

int main(){
    cin >> n;
    for(int i = 1;i <= n;i++)cin >> a[i];
    for(int i = 1;i <= n;i++)a[i] += a[i-1];
    for(int i = 1;i <= n;i++){
        for(int j = i;j <= n;j++){
            nums.emplace_back(pair<LL, LL>(i, j));
        }
    }
    sort(ALL(nums), comp);
    REP(i, (int)nums.size()){
        int from = nums[i].first;
        int to = nums[i].second;
        if(from == 1){
            dp[from][to] = 1;
        }
        else if(maxdp[from - 1]){
            dp[from][to] = max(maxdp[from - 1] + 1, dp[from][to]);
        }
        maxdp[to] = max(maxdp[to], dp[from][to]);
    }
    int m = maxdp[n];
    cout << m << endl;
    for(int x = n;x >= 1;){
        for(int j = x;j >= 0;j--){
            if(dp[j][x] == m){
                m--;
                ans.emplace_back(j);
                x = j - 1;
                break;
            }
        }
    }   
    for(int i = ans.size() - 2;i >= 0;i--){
        cout << ans[i] - 1;
        if(i)cout << " ";
    }       
    cout << endl;
    return 0;
}

### Prompt

Generate a Cpp solution to the following problem:

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 "bits/stdc++.h"
using namespace std;
using LL = long long;
using ULL = unsigned long long;
const double PI = acos(-1);
template<class T>constexpr T INF() { return ::std::numeric_limits<T>::max(); }
template<class T>constexpr T HINF() { return INF<T>() / 2; }
template <typename T_char>T_char TL(T_char cX) { return tolower(cX); };
template <typename T_char>T_char TU(T_char cX) { return toupper(cX); };
typedef pair<LL, LL> pii;
const int vy[] = { -1, -1, -1, 0, 1, 1, 1, 0 }, vx[] = { -1, 0, 1, 1, 1, 0, -1, -1 };
const int dx[4] = { 0,1,0,-1 }, dy[4] = { 1,0,-1,0 };
int popcnt(unsigned long long n) { int cnt = 0; for (int i = 0; i < 64; i++)if ((n >> i) & 1)cnt++; return cnt; }
int d_sum(LL n) { int ret = 0; while (n > 0) { ret += n % 10; n /= 10; }return ret; }
int d_cnt(LL n) { int ret = 0; while (n > 0) { ret++; n /= 10; }return ret; }
LL gcd(LL a, LL b) { if (b == 0)return a; return gcd(b, a%b); };
LL lcm(LL a, LL b) { LL g = gcd(a, b); return a / g*b; };
# define ALL(qpqpq)           (qpqpq).begin(),(qpqpq).end()
# define UNIQUE(wpwpw)        sort(ALL((wpwpw)));(wpwpw).erase(unique(ALL((wpwpw))),(wpwpw).end())
# define LOWER(epepe)         transform(ALL((epepe)),(epepe).begin(),TL<char>)
# define UPPER(rprpr)         transform(ALL((rprpr)),(rprpr).begin(),TU<char>)
# define FOR(i,tptpt,ypypy)   for(LL i=(tptpt);i<(ypypy);i++)
# define REP(i,upupu)         FOR(i,0,upupu)
# define INIT                 std::ios::sync_with_stdio(false);std::cin.tie(0)

LL a[4320];
LL p = 0;

vector<int> ans;
vector<pair<LL, LL>> nums;
int maxdp[4040];
int dp[4040][4040];
int n;
bool comp(const pair<LL, LL> &x, const pair<LL, LL> &y){
    if(a[x.second] - a[x.first - 1] == a[y.second] - a[y.first - 1]){
        return x > y;
    }
    return a[x.second] - a[x.first - 1] < a[y.second] - a[y.first - 1];
}

int main(){
    cin >> n;
    for(int i = 1;i <= n;i++)cin >> a[i];
    for(int i = 1;i <= n;i++)a[i] += a[i-1];
    for(int i = 1;i <= n;i++){
        for(int j = i;j <= n;j++){
            nums.emplace_back(pair<LL, LL>(i, j));
        }
    }
    sort(ALL(nums), comp);
    REP(i, (int)nums.size()){
        int from = nums[i].first;
        int to = nums[i].second;
        if(from == 1){
            dp[from][to] = 1;
        }
        else if(maxdp[from - 1]){
            dp[from][to] = max(maxdp[from - 1] + 1, dp[from][to]);
        }
        maxdp[to] = max(maxdp[to], dp[from][to]);
    }
    int m = maxdp[n];
    cout << m << endl;
    for(int x = n;x >= 1;){
        for(int j = x;j >= 0;j--){
            if(dp[j][x] == m){
                m--;
                ans.emplace_back(j);
                x = j - 1;
                break;
            }
        }
    }   
    for(int i = ans.size() - 2;i >= 0;i--){
        cout << ans[i] - 1;
        if(i)cout << " ";
    }       
    cout << endl;
    return 0;
}

```