
#include <bits/stdc++.h>

using namespace std;
typedef long long ll ;

#define pb push_back
#define mk make_pair
#define F first
#define S second
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define RemoveDuplicates(a) a.resize(unique(all(a))-a.begin())
#define Debug(x) cerr<<"["<<#x<<": "<<x<<"]"

# define M_PI          3.141592653589793238462643383279502884L /* pi */

const ll M=1e9+7;
const ll MaxM=1e11;

void files(){freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);}
void fast(){ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);}


void SieveOfEratosthenes(vector<ll> &v,ll n)   //all prime <= n
{
    bool prime[n+1];
    memset(prime, true, sizeof(prime));
    for (int p=2; p*p<=n; p++)
    {
        if (prime[p] == true)
        {
            for (int i=p*p; i<=n; i += p)
                prime[i] = false;
        }
    }

    for (int p=2; p<=n; p++)
       if (prime[p]){v.push_back(p);}
          //cout << p << " ";
}


bool isPowerOfTwo (int x)
{
    return x && (!(x&(x-1)));
}

bool ip(ll n){

  for(ll i=2;i*i<=n;i++){
    if(n%i==0){return true;}
  }

return false;
}


ll binpow2(ll a,ll b,ll m){
    a%=m;
    ll res=1;
    while (b>0){
        if (b & 1)
        res=res*a%m;
        a=a*a%m;
        b>>=1;
    }
    return res;
}


bool comp(pair<ll,ll> a,pair<ll,ll>b){
    if(a.S==b.S){return a.F<b.F;}
    return a.S<b.S;
}

bool isprime(ll x){
  if(x==2){return true;}
  if(x%2==0){return false;}
  for(int i=3;i*i<x;i+2){
    if(x%i==0){return false;}
  }
  return true;
}





void solveA(){
    
    ll n; double k; cin>>n>>k;

    ll ans=0,sum=0;
    ll p[n];for(int i=0;i<n;i++){cin>>p[i]; sum+=p[i];}

 

    for(int i=n-1;i>0;i--){
     sum-=p[i];
     double c= ((double)p[i])/sum;
     if(c*100>k){
      ll z= ( (100 * p[i]) - (k*sum)+k-1)/k;
                ans=max(ans,z);
     }

    }
    

cout<<ans<<endl;



}





int main(){
  fast();

   int t=1;
   cin>>t;
   while(t--){
     solveA();
    }

//cerr<<"time taken : "<<(float)clock()/CLOCKS_PER_SEC<<" secs"<<endl;


 }

