#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;

int n;

struct Info{
	short cost;
	short currentIndex; // <- index to itteruga jissai soeji nanode kokoha id
	short prevIndex;
	short prevId;
	Info(short cost,short currentIndex,short prevIndex,short prevId) : cost(cost) , currentIndex(currentIndex) , prevIndex(prevIndex) , prevId(prevId) {}
	Info(){cost=-11111;currentIndex=prevIndex=prevId=-1;}
};

bool operator < (const Info &a,const Info &b){
	return a.cost < b.cost;
}

long long A[4444];
vector<Info> dp[4444];
vector<long long> sum[4444];
long long psum[4444];


void Add(vector<Info> &table,int i,Info v ){
	i++;
	for( ; i < table.size() ; i += i&-i ){
		if( table[i] < v ){
			table[i] = v;
		}
	} 
}

Info Get(vector<Info> &table,int i){
	i++;
	Info ans;
	for( ; i > 0 ; i -= i&-i ){
	
		if( ans < table[i] ){
			ans = table[i];
		}
	}
	return ans;
}

int main(){
	cin >> n;
	for(int i = 0 ; i < n ; i++) cin >> A[i];
	
	for(int i = 0 ; i < n ; i++){
		long long s = 0;
		psum[i] = (i ? psum[i-1] : 0) + A[i];
		for(int j = 0 ; j < i ; j++){
			s += A[j];
			sum[i].push_back(psum[i]-s);
		}
		sum[i].push_back(psum[i]);
		dp[i].resize(sum[i].size()+1);
		sort(sum[i].begin(),sum[i].end());
		sum[i].erase(unique(sum[i].begin(),sum[i].end()),sum[i].end());
	}
	
	
	for(int i = 0 ; i < n ; i++){
		long long c = psum[i];
		int id2 = lower_bound(sum[i].begin(),sum[i].end(),c) - sum[i].begin();
		Add(dp[i],id2,Info(1,id2,i,-1));
	}
	
	for(int i = 0 ; i < n ; i++){
		
		for(int j = 0 ; j < i ; j++){
			long long c = psum[i] - psum[j];
			int id = lower_bound(sum[j].begin(),sum[j].end(),c) - sum[j].begin() - 1;
			int id2 = lower_bound(sum[i].begin(),sum[i].end(),c) - sum[i].begin();
			
			if( id < 0 ) continue;
			Info res = Get(dp[j],id);
			//cout << i << " " << j << " " << c << " | " << " " << sum[j][id] << " < " << sum[i][id2] << " [" << res.cost << " " << res.currentIndex << "]" << id2 << endl;
			//cout << i << ":" << j << " " << res.cost << " " << sum[j][id] << " " << sum[i][id2] << endl;
			Add(dp[i],id2,Info(res.cost+1,id2,j,res.currentIndex));
		}
	}
	
	Info ans = Get(dp[n-1],sum[n-1].size()-1);
	//cout << ans.cost << " " << ans.prevIndex << " " << ans.prevId << endl;
	vector<int> output;
	while(ans.prevId != -1){
		//cout << ans.currentIndex << ":" << ans.prevIndex << " " << "(" << sum[ans.prevIndex][ans.prevId] << ")" << endl;
		output.push_back(ans.prevIndex);
	
		ans = Get(dp[ans.prevIndex],ans.prevId);
		//cout << 
	}
	reverse(output.begin(),output.end());
	cout << output.size() + 1 << endl;
	for(int i = 0 ; i < output.size() ; i++){
		if( i ) cout << " ";
		cout << output[i] + 1;
	}
	cout << endl;
	
}
### 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 <algorithm>
#include <vector>
using namespace std;

int n;

struct Info{
	short cost;
	short currentIndex; // <- index to itteruga jissai soeji nanode kokoha id
	short prevIndex;
	short prevId;
	Info(short cost,short currentIndex,short prevIndex,short prevId) : cost(cost) , currentIndex(currentIndex) , prevIndex(prevIndex) , prevId(prevId) {}
	Info(){cost=-11111;currentIndex=prevIndex=prevId=-1;}
};

bool operator < (const Info &a,const Info &b){
	return a.cost < b.cost;
}

long long A[4444];
vector<Info> dp[4444];
vector<long long> sum[4444];
long long psum[4444];


void Add(vector<Info> &table,int i,Info v ){
	i++;
	for( ; i < table.size() ; i += i&-i ){
		if( table[i] < v ){
			table[i] = v;
		}
	} 
}

Info Get(vector<Info> &table,int i){
	i++;
	Info ans;
	for( ; i > 0 ; i -= i&-i ){
	
		if( ans < table[i] ){
			ans = table[i];
		}
	}
	return ans;
}

int main(){
	cin >> n;
	for(int i = 0 ; i < n ; i++) cin >> A[i];
	
	for(int i = 0 ; i < n ; i++){
		long long s = 0;
		psum[i] = (i ? psum[i-1] : 0) + A[i];
		for(int j = 0 ; j < i ; j++){
			s += A[j];
			sum[i].push_back(psum[i]-s);
		}
		sum[i].push_back(psum[i]);
		dp[i].resize(sum[i].size()+1);
		sort(sum[i].begin(),sum[i].end());
		sum[i].erase(unique(sum[i].begin(),sum[i].end()),sum[i].end());
	}
	
	
	for(int i = 0 ; i < n ; i++){
		long long c = psum[i];
		int id2 = lower_bound(sum[i].begin(),sum[i].end(),c) - sum[i].begin();
		Add(dp[i],id2,Info(1,id2,i,-1));
	}
	
	for(int i = 0 ; i < n ; i++){
		
		for(int j = 0 ; j < i ; j++){
			long long c = psum[i] - psum[j];
			int id = lower_bound(sum[j].begin(),sum[j].end(),c) - sum[j].begin() - 1;
			int id2 = lower_bound(sum[i].begin(),sum[i].end(),c) - sum[i].begin();
			
			if( id < 0 ) continue;
			Info res = Get(dp[j],id);
			//cout << i << " " << j << " " << c << " | " << " " << sum[j][id] << " < " << sum[i][id2] << " [" << res.cost << " " << res.currentIndex << "]" << id2 << endl;
			//cout << i << ":" << j << " " << res.cost << " " << sum[j][id] << " " << sum[i][id2] << endl;
			Add(dp[i],id2,Info(res.cost+1,id2,j,res.currentIndex));
		}
	}
	
	Info ans = Get(dp[n-1],sum[n-1].size()-1);
	//cout << ans.cost << " " << ans.prevIndex << " " << ans.prevId << endl;
	vector<int> output;
	while(ans.prevId != -1){
		//cout << ans.currentIndex << ":" << ans.prevIndex << " " << "(" << sum[ans.prevIndex][ans.prevId] << ")" << endl;
		output.push_back(ans.prevIndex);
	
		ans = Get(dp[ans.prevIndex],ans.prevId);
		//cout << 
	}
	reverse(output.begin(),output.end());
	cout << output.size() + 1 << endl;
	for(int i = 0 ; i < output.size() ; i++){
		if( i ) cout << " ";
		cout << output[i] + 1;
	}
	cout << endl;
	
}
```