#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <queue>

using namespace std;

typedef long long ll;
typedef vector<int> vi;

#define dbg(x) cerr << x << endl

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	
	ll t;
	cin >> t;

	for (size_t ii = 0; ii < t; ii++)
	{
		ll n, q, result = 0;
		cin >> n >> q;
		vector<bool> tests(n);
		for (size_t i = 0; i < n; i++)
		{
			int test;
			cin >> test;
			tests[i] = test;
		}
		for (size_t i = 0; i < n; i++)
		{
			for (size_t j = 0; j <= i; j++)
			{
				ll sum = 0, cnt = 0;
				for (size_t g = j; g <= i; g++, cnt++)
				{
					if (tests[g])
					{
						sum++;
					}
				}
				if (sum*100 >= q*cnt)
				{
					result++;
				}
			}
		}
		dbg("Result = " << result);
		cout << result << " ";
	}

	return 0;
}