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 <iostream>
using namespace std;
#define rep(i,n) for(int i = 0 ; 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[1000];
    x[0] = 0;
    int gol = 0.0;
    int h = 0;
    double kekka;
    
    rep(i, n){
      cin >> x[i];
      h += x[i];
      gol += 100 * x[i];
    }
    kekka = gol - gol*p/100;
    double ans = 0.0;
    rep(i, n){
      if(i == m && m != 0){
	ans = kekka/x[i];
      }else{
	ans = 0;
	break;
      }
    }
    cout << ans << '\n';
  }
}

C++: #include <bits/stdc++.h>
#define ll long long
#define INF 1000000005
#define MOD 1000000007
#define EPS 1e-10
#define rep(i,n) for(int i=0;i<(int)n;++i)
#define each(a, b) for(auto (a): (b))
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
#define pb push_back
#define sint(x) cout <<#x<<" = "<<(x)<<endl
#define spair(p) cout <<#p<<": "<<p.fi<<" "<<p.se<<endl
#define svec(v) cout<<#v<<":";rep(i,v.size())cout<<" "<<v[i];cout<<endl
#define sset(s) cout<<#s<<":";each(i,s)cout <<" "<<i;cout<<endl

using namespace std;


typedef pair<int,int>P;

const int MAX_N = 100005;

int n,m,p;

int main()
{
    while(1){
        cin >> n >> m >> p;
        if(n == 0){
            break;
        }
        vector<int> vec(n);
        rep(i,n){
            cin >> vec[i];
        }
        if(vec[m-1] == 0){
            cout << "0\n";
            continue;
        }
        int sm = accumulate(all(vec),0);
        cout << (int)((double)sm*(100-p)/vec[m-1]) << "\n";
    }
}

C++: // AOJ 2018
#include<iostream>
#include<vector>
using namespace std;

int solve(int N, int M, int P, vector<int> Xs) {
  int sum = 0;
  for (int i = 0; i < N; i++) {
    sum += Xs[i];
  }

  return (Xs[M-1] ? sum * (100 - P) / Xs[M-1]:0);
}

int main() {
  int n, m, p;
  while(cin >> n >> m >> p and n) {
    vector<int> xs(n);
    for (int i = 0; i < n; i++) {
      cin >> xs[i];
    }
    cout << solve(n, m, p, xs) << endl;
  }
}

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

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

  while (cin >> N >> M >> P, N != 0) {
    int num = 0;
    int sum = 0;
    for (int i = 0; i < N; i++) {
      int X;
      cin >> X;

      if (i == M - 1) {
        num = X;
      }

      sum += X;
    }

    cout << (num != 0 ? sum * 100 / num * (100 - P) / 100 : 0) << endl;
  }

  return 0;
}

C++: #include <bits/stdc++.h>
#define _overload(_1,_2,_3,name,...) name
#define _rep(i,n) _range(i,0,n)
#define _range(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define rep(...) _overload(__VA_ARGS__,_range,_rep,)(__VA_ARGS__)
#define _all(arg) begin(arg),end(arg)

template<class T>bool chmax(T &a, const T &b) { return (a<b)?(a=b,1):0; }
template<class T>bool chmin(T &a, const T &b) { return (b<a)?(a=b,1):0; }

using namespace std;

int main(void){
	int n, m, p;
	while(cin>>n>>m>>p, n,m,p) {
		vector<int> x(n);
		int sum = 0;
		rep(i,n) {cin >> x[i]; sum+=x[i];}
		cout << ((x[m-1]) ? (sum*(100-p)/x[m-1]) : 0) << endl;
	}
        
	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
#define reps(i,j,k) for(int i=j;i<k;++i)
#define rep(i,j) reps(i,0,j)
int main(){
	int n, m, s;
	while (true){
		cin >> n >> m >> s;
		if (n + m + s == 0)break;
		int p;
		int sum = 0;
		int g = -1;
		rep(i, n){
			scanf("%d", &p);
			if (i == m - 1){
				g = p;
			}
			sum += p;
		}
		if (g == 0){
			puts("0");
		}
		else{
			int res = sum * (100 - s) / g;
			cout << res << "\n";
		}
	}
	return 0;
}

C++: #include<iostream>
main(){for(int N,M,P,X,S,i,m;std::cin>>N>>M>>P,N|M|P;m?printf("%d\n",S*(100-P)/m):puts("0"))for(S=i=0;i<N;S+=X*100,i++-M+1||(m=X*100))std::cin>>X;}

C++: #include <cstdio>

int N, M, P, S, X[101];

int main()
{
	while (true)
	{
		scanf("%d%d%d", &N, &M, &P);

		if (N == 0) { break; }

		for (int i = 1; i <= N; i++) { scanf("%d", &X[i]); S += X[i]; }

		printf("%d\n", X[M] == 0 ? 0 : P * S / X[M]);
	}

	return 0;
}

C++: #include <stdio.h>
int main(void)
{
  int n,m,p,i,summ,sump,div;
  for(;;)
    {
      sump=0;
      scanf("%d %d %d",&n,&m,&p);
      if(m==0 && n ==0 && p==0){break;}
      int player[n];
      for(i=0;i<n;i++)
	{
	  scanf("%d",&player[i]);
	  sump=sump+player[i];
	}
      summ=sump*(100-p);
      if(player[m-1]==0){printf("%d\n",0);}
      else
	{
	div=summ/player[m-1];
	/*printf("sump=%d summ=%d div=%d\n",sump,summ,div);*/
	printf("%d\n",div);
	}
    }
  return 0;
}

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

int main() {
  for(int N, M, P; cin >> N >> M >> P && (N|M|P); ) {
    --M;
    vector<int> X(N);
    for(int i = 0; i < N; ++i) cin >> X[i];
    int pool = accumulate(X.begin(), X.end(), 0);
    if(X[M] == 0) cout << 0 << endl;
    else cout << pool * (100 - P) / X[M] << endl;
  }
  return 0;
}

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

#define dump(x) cout << (x) << '\n'
#define Int int64_t
#define fi first
#define se second
#define all(x) (x).begin(), (x).end()

Int INF = 1e18;
int inf = 1e9;
Int mod = 1e9+7;

int main() {
    vector<int> res;
    int n, m, p;
    while (cin >> n >> m >> p and n) {
        p = 100 - p;
        m--;
        vector<int> x(n);
        for (int i = 0; i < n; i++) {
            cin >> x[i];
        }
        if (x[m] == 0) {
            res.push_back(0);
            continue;
        }
        int sum = 0;
        for (int i = 0; i < n; i++) {
            sum += x[i] * 100;
        }
        sum = (double)sum * (double)p / 100.0;
        res.push_back(sum / (double)x[m]);
    }
    for (int i = 0; i < (int)res.size(); i++) {
        dump(res[i]);
    }
    return 0;
}

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

int main(){  
	int n, m, p, x, sum, res;
	while(cin >> n >> m >> p, n | m | p){
		sum = 0;
		for(int i = 1;i <= n;i++){
			cin >> x;
			sum += x;
			if(i == m)res = x;
		}
		if(res == 0)cout << 0 << endl;
		else cout << sum*(100 - p)/res << endl;
	}
	return 0;
}

C++: #include <iostream>

using namespace std;

int main(){
	int N, M, P;
	
	while(cin >> N >> M >> P, N+M+P){
		int x[N], sum = 0, ans = 0;
		for(int i = 0; i < N; ++i){
			cin >> x[i];
			sum += 100 * x[i];
		}
		sum =  sum * (100 - P) * 0.01;
		if(x[M - 1] != 0)
			ans = sum / x[M - 1];
		cout << ans << endl;
	}
}

C++: #include<iostream>

using namespace std;

int main(){
  int N,M,X[1000],kazu=0,P;
  double kane=0;
  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*(1.0-(double)P*0.01)/X[M-1];
      }

      cout<<(int)kane<<endl;
      kane=0;
      kazu=0;
      for(int lop=0;lop<N;lop++){
          X[lop]=0;
      }
  }

  return 0;
}

C++: #include <iostream>

using namespace std;

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

C++: #include<iostream>
using namespace std;
int main(){
	int N,M,P;
	while(cin>>N>>M>>P){
		if(N==0)break;
		int c=0;
		int d[1100]={},cn=0;
		for(int i=1;i<=N;i++){
			cin>>c;
			d[i]=c;
			cn+=c;
		}
		if(d[M]==0){
			cout<<0<<endl;
		}
		else{
			cout<<((cn*(100-P))-((cn*(100-P))%d[M]))/d[M]<<endl;
		}
	}
	return 0;
}