//#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[]) {
    int B = 0, mas = 0, i = 0;
    while (mas <= M) {
//    	debug(i);
//    	debug(B);
//    	debug(mas);
		if (i == N-B) {
			i = 0;
			B++;
		}
		int curr = 0;
		for (int j = i; j<i+B+1; j++) {
			curr += V[j];
//			debug(curr);
		}
		if (curr>mas) mas = curr;
//		debug(curr);
//		debug(mas);	
		i++;
	}
	
    return B;
}
