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

void solve() {
	int n, k;
	cin >> n >> k;
	vector<int> p(n);
	for(int i = 0; i < n; i++)
		cin >> p[i];

	long long s = p[0];
	long long res = 0;
	for(int i = 1; i < n; i++) {
		if((long long) 100 * p[i] > (long long) k * s) {
			long long need = (((long long) 100 * p[i] + k - 1) / k) - s;
			res = max(res, need);
		}
		s += p[i];
	}

	cout << res << '\n';
}

int main() {
	int t;
	cin >> t;
	while(t--)
		solve();	
}
