#include <numeric>
using namespace std;

int quadri(int N, long long M, int V[]) {
    // Scrivete qui la vostra soluzione
    int risposta = 0;
    long long somma = 0;
    int v = false;
    for(int i = 0; i < N; i++){
        for(int a = N; a >= 0; a--){
            v = true
            somma = accumulate(V, V + a, OLL);
            if(somma < M){
                for(int b = 0; b + a < N; b++){
                    v = false
                    somma = accumulate(V + b, V + b + a, OLL);
                    if(somma < M){
                        risposta = a;
                        v = true;
                    } else{
                        v = false;
                        break;
                    }
                }
                if(v){
                    return risposta;
                }
            } else{
                continue;
            }
        }
    }
    return risposta;
}


