//WTF??? NR...  it's end of my fucking life
//ONE LOVE...???
//ONE HATE...???
//one ignore????

#include <bits/stdc++.h>
#define en "\n"
#define mp(x,y) make_pair(x,y)
typedef long long ll;
typedef long double ld;
int arr[500500],prevv[500500];
using namespace std;
int main()
{
    int t;
    cin>>t;
    while (t--){
        int n;
        cin>>n;
        double q;
        cin>>q;
        q/=100;
        for (int i=0; i<n; ++i) cin>>arr[i];
        prevv[0]=arr[0];
        int cnt=0;
        for (int i=1; i<n; ++i) prevv[i]=prevv[i-1]+arr[i];
        for (int i=0; i<n; ++i)
        for (int j=i; j<n; ++j){
            if (i==0){
                if (prevv[j]/(1.0*j+1)>=q) ++cnt;
            }else{
                if (((prevv[j]-prevv[i-1])/((j-i+1)*1.0))>=q) ++cnt;
            }

        }
        cout<<cnt<<" ";
    }

    return 0;
}
