#include <iostream>

using namespace std;

int main()
{
    cin.tie(NULL);
    cout.tie(NULL);
    ios_base::sync_with_stdio(0);

    int kolvo_ed[100000], answs[100000];
    kolvo_ed[0] = 0;
    int t, n, q, otvet;
    cin >> t;
    while (t > 0){
        --t;
        otvet = 0;
        cin >> n >> q;
        for (int i = 1; i <= n; ++i){
            cin >> answs[i];
            kolvo_ed[i] = kolvo_ed[i-1] + answs[i];
        }

        for (int l = 1; l <= n; ++l){
            for (int r = l; r <= n; ++r){
                if ( (kolvo_ed[r] - kolvo_ed[l-1]) * 100 >= q * (r - l + 1) ){
                    ++otvet;
                }
            }
        }
        if (t) cout << otvet << " ";
        else cout << otvet;
    }
    return 0;
}
