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

int main() 
{
    //Atleast K
    int n=5;
    int a[] = {1 , 11 , 2 , 3 , 15};
    int k = 10;

    int cnt = 0;
    int sum = 0;

    int i=0 , j=0;
    while(j<n)
    {
        // do calculation
        sum = sum + a[j]; // Running sum find out kela 

        if(sum < k)
        {
            j++; // we will simple increment ' j ' pointer
        }
        else if(sum>=k)
        {
            while(i<=j  &&  sum>=k)
            {
                // we will find ans <- from the calculation
                cnt = cnt + (n-j);

                sum = sum - a[i]; // from left of the window we will remove the element  'i' index element 

                i++; // after removing that element we will do i++
            }
            j++;  // and we will also do j++
        }
    }
    cout<<cnt<<" ";
}