Go: package main

import (
	"fmt"
	"math"
)

func main() {
	var M, N, P int
	for {
		fmt.Scan(&N, &M, &P)
		if N == 0 && M == 0 && P == 0 {
			return
		}

		arr := make([]int, N)
		sum := 0
		for i := 0; i < N; i++ {
			var po int
			fmt.Scan(&po)
			arr[i] = po
			sum += po
		}

		if arr[M-1] == 0 {
			fmt.Println(0)
		} else {
			fmt.Println(math.Floor(float64(sum * (100 - P) / arr[M-1])))
		}
	}
}

C++: #include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
#define bye return 0

int main(){
  int N,M,P;
  while(cin>>N>>M>>P,N&&M&&P){
    int X[1000],sum=0;
    rep(i,N){
     cin>>X[i];
     sum+=100*X[i];
    }
    sum=sum-sum*P/100;
    rep(i,N+1){
      if(M==i){
        if(X[i-1]!=0){
         cout<<sum/X[i-1]<<endl;
         return 0;
	}else {
          cout<<'0'<<endl;
          return 0;
	}
      }
    }
  }
  return 0;
}

C++: #include <iostream>
#include <vector>
#include <algorithm>
#include <numeric>
#include <set>
#include <map>
#include <string>
#include <stack>
#include <queue>
#include <cmath>
#include <cstdio>
using namespace std;

int main(void) {
	int athNum, winUser, exRate;
	while (cin >> athNum >> winUser >> exRate, athNum) {
		int winBet;
		int betSum = 0;
		for (int i = 1; i <= athNum; i++) {
			int bet;
			cin >> bet;
			betSum += bet;
			if (i == winUser) {
				winBet = bet;
			}
		}
		
		if (!winBet) {
			cout << 0 << endl;
		}else {
			double exRate_d = (double)exRate / 100;
			int price = (int)(betSum * 100 * (1 - exRate_d) / winBet);
			cout << price << endl;
		}
	}

	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std ;

#define pb(n) push_back(n)
#define fi first
#define se second
#define all(r) (r).begin(),(r).end()
#define gsort(st,en) sort((st),(en),greater<int>())
#define vmax(ary) *max_element(all(ary))
#define vmin(ary) *min_element(all(ary))
#define debug(x) cout<<#x<<": "<<x<<endl
#define fcout(n) cout<<fixed<<setprecision((n))
#define scout(n) cout<<setw(n)
#define vary(type,name,size,init) vector< type> name(size,init)
#define vvl(v,w,h,init) vector<vector<ll>> v(w,vector<ll>(h,init));

#define rep(i,n) for(int i = 0; i < (int)(n);++i)
#define REP(i,a,b) for(int i = (a);i < (int)(b);++i)
#define repi(it,array) for(auto it = array.begin(),end = array.end(); it != end;++it)
#define repa(n,array) for(auto &n :(array))

using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using dict = map<string,int>;
using pii = pair<int,int> ;
using pll = pair<ll,ll> ;

const int mod = 1000000007;
constexpr int imax = ((1<<30)-1)*2+1 ;
constexpr int inf = 100000000;
constexpr double PI = acos(-1.0) ;
double eps = 1e-10 ;
const int dy[] = {-1,0,1,0,1,-1,1,-1};
const int dx[] = {0,-1,0,1,1,-1,-1,1};

inline bool value(int x,int y,int w,int h){
  return (x >= 0 && x < w && y >= 0 && y < h);
}

template<typename T>
void Unique(vector<T> &v){
  sort(all(v));
  v.erase(unique(all(v)),v.end());
}

template<typename T>
T ston(string& str, T n){
  istringstream sin(str) ;
  T num ;
  sin >> num ;
  return num ;
}

void Ans(bool f){
  if(f) cout << "YES"<<endl;
  else cout << "NO"<<endl;
}

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll n,m ,p;
  while(cin >> n >> m >> p && n && m && p){
    vary(double,x,n,0);
    double pool = 0;
    rep(i,n){
      cin >> x[i];
      pool += x[i] ;
    }
    pool *= (100-p);
//     debug(pool);
    if(x[m-1] != 0){
      cout << (int)(pool / x[m-1])<<endl;
    }
    else{
      cout << 0 << endl;
    }
  }
  return 0;
}

C++: #include<bits/stdc++.h>
#include<stdio.h>
using namespace std;

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define REP(i,k,n) for(int i=k;i<(int)(n);i++)

#define vi vector<int>
#define pb push_back
#define mp make_pair

typedef long long ll;

int main() {

    int n, m, p;
    int x[1100];
    while (cin >> n >> m >> p, n != 0) {
        memset(x,0,sizeof(x));
        rep(i, n)cin >> x[i + 1];

        int sum = 0;
        rep(i, n)sum += x[i + 1];
        double ans = 0;
        if (x[m]!=0) ans = sum * 100 * ((100 - p) / 100.0 )/ x[m];

        printf("%.0lf\n", ans);
    }

    return 0;
}

C++: #include <iostream>
using namespace std;
#define rep(i,n) for(int i = 1 ; i <= n ; i++)

int main(){
  while(true){
    int n, m, p;
    cin >> n >> m >> p;
    if(n == 0 && m == 0 && p == 0)break;
    int x;
    int hito = 0, sum = 0;;
    
    
    rep(i, n){
      cin >> x;
      sum += x;
      if(i == m){
	hito = x;
      }
    }
    if(hito == 0){
      cout << 0 << '\n';
    }else{
      cout << sum*(100-p)/hito << '\n';
    }
  }
}

C++: #include<iostream>
using namespace std;
int main(){
	int n,m,p;
	while(cin>>n>>m>>p,n,m){
		int ans=0,d[n];
		double sum=0.0;
		for(int i=0;i<n;i++){
			cin>>d[i];
			sum+=d[i];
		}
		sum*=100;
		sum-=sum*(p*1.0/100);
		if(d[m-1]){
			ans=sum/d[m-1];
			cout<<ans<<endl;
		}
		else
		cout<<0<<endl;
	}
}

C++: #include<bits/stdc++.h>
using namespace std;

int main(){
  int n, m, p;
  cin >> n >> m >> p;
  while(n != 0 && m != 0 && p != 0){
    m--;
    vector<int> v(n);
    int sum = 0;
    for(int i = 0; i < n; i++){
      cin >> v[i];
      sum += 100 * v[i];
    }
    sum -= sum * p/ 100;
    
    if(v[m] == 0)cout << 0 << endl;
    else cout << sum / v[m] << endl;

    cin >> n >> m >> p; 
  }
}

C++: #include <iostream>
using namespace std;

int main()
{
    int N,M,P,i,j,k,sum=0,gold=0,h,w,get;
    int x[100];

    for (i=0; ; i++)
    {
        cin>>N>>M>>P;
        if (N==0&&M==0&&P==0)
        {
            break;
        }
        for (j=1; j<N+1; j++)
        {
            cin>>x[j];
            sum=sum+x[j];
        }
        gold=sum*100;
        w=100-P;
        h=gold*w/100;
        
        for (k=1; ; k++)
        {
            if (k==M)
            {
                if(x[k]==0)
                {
                    cout<<0<<endl;
                    break;
                }
                    
                get=h/x[k];
                cout<<get<<endl;
                break;
            }
        }
        sum=0;
        h=0;
    }

    return 0;
}

C++: #include <cstdio>
int main() {
	int N,M,P;
	while(scanf("%d %d %d",&N,&M,&P),N) {
		int sum=0,size=0;
		for(int i=0;i<N;i++) {
			int X;
			scanf("%d",&X);
			sum+=X*100;
			if(i==M-1) size=X;
		}
		sum*=(100-P)/100.0;
		if(size==0) {
			printf("0\n");
		}else {
			printf("%d\n",sum/size);
		}
	}
}

C++: #include <iostream>
#include <vector>

using namespace std;

int main() {
	int N, M, P;

	while (cin >> N >> M >> P && N && M && P) {
		vector<int> X(N);
		int sum = 0;
		for (int i = 0; i < N; i++) {
			cin >> X[i];
			sum += X[i];
		}

		if (!X[M-1]) {
			cout << 0 << endl;
		} else {
			cout << ((100-P)*sum)/X[M-1] << endl;
		}
	}

	return 0;
}

C++: #include<iostream>

using namespace std;

int main(){
  int N,M,X[1000],kazu=0,kane=0,P;
  while(1){
      cin>>N;
      cin>>M;
      cin>>P;
      if(N==0 && M==0 && P==0){
        break;
      }
      for(int lop=0;lop<N;lop++){
          cin>>X[lop];
          kazu+=X[lop];
      }
      if(X[M-1]==0){
        kane=0;
      }else{
        kane=kazu*100;
        kane*=(double)(1.0-P*0.01);
        kane=(double)(kane/X[M-1]);
      }
      cout<<kane<<endl;
      kane=0;
      kazu=0;
      for(int lop=0;lop<N;lop++){
          X[lop]=0;
      }
  }

  return 0;
}

C++: #include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
#include <limits.h>




int main()
{
	int i,j,k;
	int n,m;
	int sum;
	int winner;
	int p;

	while(1)
	{
		scanf("%d %d %d",&n,&m,&p);
		if((n==0)&&(m==0)&&(p==0)){break;}
		else
		{
			sum=0;
			winner=0;
			for(i=0;i<n;i++)
			{
				int x;
				scanf("%d",&x);
				sum+=x;
				if((i+1)==m){winner=x;}
			}
		}
		if(winner==0){printf("0\n");}else{
			printf("%d\n",(sum*(100-p)/winner));}
	}
	return 0;
}