#include<bits/stdc++.h>
using namespace std;

#define int long long
typedef vector<int>vint;
typedef pair<int,int>pint;
typedef vector<pint>vpint;
#define rep(i,n) for(int i=0;i<(n);i++)
#define reps(i,f,n) for(int i=(f);i<(n);i++)
#define all(v) (v).begin(),(v).end()
#define each(it,v) for(__typeof((v).begin()) it=(v).begin();it!=(v).end();it++)
#define pb push_back
#define fi first
#define se second
template<typename A,typename B>inline void chmin(A &a,B b){if(a>b)a=b;}
template<typename A,typename B>inline void chmax(A &a,B b){if(a<b)a=b;}

const int INF=1001001001001001001ll;

struct segtree{
    static const int SEG=1<<12;
    vpint dat;
    segtree():dat(SEG*2,pint(-INF,-1)){}
    void init(){
        fill(all(dat),pint(-INF,-1));
    }
    void update(int k,pint x){
        k+=SEG-1;
        chmax(dat[k],x);
        while(k){
            k=(k-1)/2;
            dat[k]=max(dat[k*2+1],dat[k*2+2]);
        }
    }
    pint query(int a,int b,int k=0,int l=0,int r=SEG){
        if(r<=a||b<=l)return pint(-INF,-1);
        if(a<=l&&r<=b)return dat[k];
        return max(query(a,b,k*2+1,l,(l+r)/2),query(a,b,k*2+2,(l+r)/2,r));
    }
};

int N;
int A[4010];
int sum[4010];
int dp[4010][4010];
short pre[4010][4010];
int idx[4010];
signed main(){
    cin>>N;
    rep(i,N)cin>>A[i];
    rep(i,N)sum[i+1]=sum[i]+A[i];

    fill_n(*dp,4010*4010,INF);
    dp[0][0]=-INF;
    segtree seg;
    for(int i=0;i<N;i++){
        seg.init();
        vpint vec;
        for(int j=0;j<N;j++)vec.pb(pint(dp[i][j]+sum[j],j));
        sort(all(vec));
        for(int j=0;j<N;j++)idx[vec[j].se]=j;

        for(int j=1;j<=N;j++){
            seg.update(idx[j-1],pint(sum[j-1],j-1));
            int lb=-1,ub=vec.size();
            while(ub-lb>1){
                int mid=(ub+lb)/2;
                if(vec[mid].fi<sum[j])lb=mid;
                else ub=mid;
            }
            if(ub==0)continue;
            pint p=seg.query(0,ub);
            if(p.fi==-INF)continue;
            dp[i+1][j]=sum[j]-p.fi;
            pre[i+1][j]=p.se;
        }

    }

    int x;
    for(x=N;;x--)if(dp[x][N]!=INF)break;
    int y=N;
    vint ans;
    for(int i=x;i>1;i--){
        y=pre[i][y];
        ans.pb(y);
    }
    reverse(all(ans));
    cout<<ans.size()+1<<endl;
    for(int i=0;i<ans.size();i++){
        if(i)cout<<" ";
        cout<<ans[i];
    }cout<<endl;

    return 0;
}
### Prompt

Your challenge is to write 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;

#define int long long
typedef vector<int>vint;
typedef pair<int,int>pint;
typedef vector<pint>vpint;
#define rep(i,n) for(int i=0;i<(n);i++)
#define reps(i,f,n) for(int i=(f);i<(n);i++)
#define all(v) (v).begin(),(v).end()
#define each(it,v) for(__typeof((v).begin()) it=(v).begin();it!=(v).end();it++)
#define pb push_back
#define fi first
#define se second
template<typename A,typename B>inline void chmin(A &a,B b){if(a>b)a=b;}
template<typename A,typename B>inline void chmax(A &a,B b){if(a<b)a=b;}

const int INF=1001001001001001001ll;

struct segtree{
    static const int SEG=1<<12;
    vpint dat;
    segtree():dat(SEG*2,pint(-INF,-1)){}
    void init(){
        fill(all(dat),pint(-INF,-1));
    }
    void update(int k,pint x){
        k+=SEG-1;
        chmax(dat[k],x);
        while(k){
            k=(k-1)/2;
            dat[k]=max(dat[k*2+1],dat[k*2+2]);
        }
    }
    pint query(int a,int b,int k=0,int l=0,int r=SEG){
        if(r<=a||b<=l)return pint(-INF,-1);
        if(a<=l&&r<=b)return dat[k];
        return max(query(a,b,k*2+1,l,(l+r)/2),query(a,b,k*2+2,(l+r)/2,r));
    }
};

int N;
int A[4010];
int sum[4010];
int dp[4010][4010];
short pre[4010][4010];
int idx[4010];
signed main(){
    cin>>N;
    rep(i,N)cin>>A[i];
    rep(i,N)sum[i+1]=sum[i]+A[i];

    fill_n(*dp,4010*4010,INF);
    dp[0][0]=-INF;
    segtree seg;
    for(int i=0;i<N;i++){
        seg.init();
        vpint vec;
        for(int j=0;j<N;j++)vec.pb(pint(dp[i][j]+sum[j],j));
        sort(all(vec));
        for(int j=0;j<N;j++)idx[vec[j].se]=j;

        for(int j=1;j<=N;j++){
            seg.update(idx[j-1],pint(sum[j-1],j-1));
            int lb=-1,ub=vec.size();
            while(ub-lb>1){
                int mid=(ub+lb)/2;
                if(vec[mid].fi<sum[j])lb=mid;
                else ub=mid;
            }
            if(ub==0)continue;
            pint p=seg.query(0,ub);
            if(p.fi==-INF)continue;
            dp[i+1][j]=sum[j]-p.fi;
            pre[i+1][j]=p.se;
        }

    }

    int x;
    for(x=N;;x--)if(dp[x][N]!=INF)break;
    int y=N;
    vint ans;
    for(int i=x;i>1;i--){
        y=pre[i][y];
        ans.pb(y);
    }
    reverse(all(ans));
    cout<<ans.size()+1<<endl;
    for(int i=0;i<ans.size();i++){
        if(i)cout<<" ";
        cout<<ans[i];
    }cout<<endl;

    return 0;
}
```