#include <bits/stdc++.h>
#define fastIO ios_base::sync_with_stdio(false); cout.tie(0)
#define endl '\n'
 
using namespace std;
#define pb push_back
typedef long long int ll;

int main()
 {
    fastIO;
    int t;
    cin>>t;
    while(t--)
    {
    	int n,k;
    	cin>>n>>k;
    	ll a[n];
    	for(int i=0;i<n;i++)
    		cin>>a[i];
    	ll p=a[0],x=0;

    	for(int i=1;i<n;i++)
    	{
    		x=max(x,(a[i]*100ll-k*p+k-1)/k);
    		p+=a[i];
    	}

    	cout<<x<<endl;

    	
    }
}