#include<bits/stdc++.h>
#define ll long long
using namespace std;
ll a[105];
int main()
{
	int t;
	cin>>t;
	while(t--)
	{
		ll n,k;
		cin>>n>>k;
		ll sum=0;
		for(int i=0;i<n;i++)
		{
			cin>>a[i];
			sum+=a[i];
		}
		ll mx=0;
		for(int i=n-1;i>=1;i--)
		{
			sum-=a[i];
			ll tmp;
			if(a[i]*100%k)
			{
				tmp=a[i]*100/k+1;
			}
			else
			{
				tmp=a[i]*100/k;
			}
			if(tmp>sum)
			{
				mx=max(mx,tmp-sum);
			}
		}
		cout<<mx<<endl;
	}
}
