#include <bits/stdc++.h>
#define int long long
#define fo(i,a,b) for(int i=a;i<=b;i++)
using namespace std;
const int maxn=105;
int p[maxn],s[maxn];
signed main(){
    int t;
    cin>>t;
    while(t--){
        int n,k,ans=0;
        cin>>n>>k;
        fo(i,1,n){cin>>p[i];}
        s[1]=p[1];
        fo(i,2,n){
            if(k*s[i-1]<100*p[i]){
                int dt=ceil((double)100*p[i]/k)-s[i-1];
                s[i-1]+=dt;
                ans+=dt;
            }
            s[i]=s[i-1]+p[i];
        }
        cout<<ans<<endl;
    }
    return 0;
}
