//1476B
#include <bits/stdc++.h>
using namespace std;
#define sc scanf
#define pr printf
#define ll long long
#define int long long 
#define mst(x) memset(x, 0 ,sizeof x)
#define FILE_OUT freopen("out", "w", stdout);
#define FILE_IN freopen("in", "r", stdin);
#define debug(a,b) cout<<a<<" : "<<b<<endl;
#define INF 0x3f3f3f3f
const ll MAX_N = 1e5+5;
const ll mod = 1e9+7;
int N, M, K;

int arr[MAX_N]; 

void solve(){
	sc("%lld%lld", &N, &K);
	for (int i = 1; i <= N; ++i){
		sc("%lld", &arr[i]);
	}
	int ans = 0;
	int sum = arr[1];
	for (int i = 2; i <= N; ++i){
		ans = max(ans, (100ll*arr[i] - K*sum + K - 1)/K);
		sum += arr[i];
	}
	pr("%lld", ans);
	puts("");
}


signed main()
{
	#ifndef ONLINE_JUDGE 
	FILE_OUT
	#endif
	int T = 1;sc("%lld", &T);
	while (T--)solve();
	return 0;
}