#include <bits/stdc++.h>
#define INF 0x3f3f3f3f
#define int long long
using namespace std;
const int N=105;
int t;
int n,k;
int a[N],pre[N]; 
signed main()
{
	scanf("%lld",&t);
	while(t--)
	{
		scanf("%lld%lld",&n,&k);
		for(int i=1;i<=n;i++)
		{
			scanf("%lld",&a[i]);
			pre[i]=pre[i-1]+a[i];
		}
		int fm=a[1];
		int ans=0;
		for(int i=2;i<=n;i++)
		{
			if(a[i]*100<=fm*k)
			{
				fm+=a[i];
				continue;
			}
			int w=a[i]*100-k*fm;
			int zhi=0;
			if(w%k==0)
			{
				zhi=w/k;
			}
			else
			{
				zhi=w/k+1;
			}
			ans+=zhi;
			fm+=zhi+a[i];
		}
		printf("%lld\n",ans);
	}
	return 0;
}
