#include<iostream>
#include<iomanip>
#include<cstdio>
#include<cstdlib>
#include<algorithm>
#include<cassert>
#include<ctime>
#include<cwctype>
#include<chrono>
#include<random>

#include<cstring>
#include<vector>
#include<queue>
#include<set>
#include<map>
#include<unordered_set>
#include<unordered_map>
#include<bitset>

#include<cmath>
#include<complex>

using namespace std;
#define szof(x) ((int) x.size())

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
	int T; cin >> T;
	for(int tt = 0; tt < T; ++tt){
		int n,k; cin >> n >> k;
		vector<long long> p(n);
		for(int i = 0; i < n; ++i) cin >> p[i];
		long long sum = p[0];
		long long diff = 0;
		for(int i = 1; i < n; ++i){
			if(sum * k < p[i] * 100) diff = max(diff, (p[i] * 100 - sum * k - 1)/k + 1);
			sum += p[i];
		}
		cout << diff << endl;
	}
}
