//#include "grader.cpp"
//#include <bits\stdc++.h>
#ifdef EVAL
#define debug(x) (x)
#else
#define debug(x) ( cerr << "[" << __LINE__ << "] " << #x << " -> " << (x) << endl, (x) )
#endif

using namespace std;

int quadri(int N, long long M, int V[]) {
	for (int i = 0; i<N; i++){
		if (V[i]>M) return 0;
	}
    int B = 1, i = 1;
    long long mas = 0;
    vector <long long> somme(N, 0);
    while (mas <= M) {
		if (i == N-B) {
			B++;
			i++;
		}
		somme[i] += V[i];
		if (somme[i]>mas) mas = somme[i];
		i += B;
	}
	
    return B;
}
