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>
#include<map>
#include<vector>
#include<list>
#include<algorithm>
#include<cmath>
#include<iomanip>
#include<numeric>
#include<climits>
#include<ctime>
#include<cstring>
#define REP(i,p,n) for(int i=p;i<(int)(n);i++)
#define rep(i,n) REP(i,0,n)
#define rep_split(tok,a_str,re) for(char *tok = strtok((char *)a_str.c_str(),re); tok != NULL; tok = strtok(NULL,re))
#define all(c) (c).begin(), (c).end()

using namespace std;

int main() {
	int N,M,P;
	int X[102];
	int sum;

	while(cin >> N >> M >> P && N && M && P) {
		sum=0;
		REP(i,1,N+1) {
			cin >> X[i];
			sum+=(X[i]*100);
		}
		if (X[M] == 0) {
			cout << "0" << endl;
		}
		else {
			int ans = (sum/X[M])*(100-P)*0.01;
			cout << ans << endl;
		}
	}

	return 0;
}

C++: #include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <string>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>

#define rep(i, j) FOR(i, 0, j)
#define FOR(i, j, k) for(int i = j; i < k; ++i)

using namespace std;

int main(){
  int n, m, p, x[101], sum;
  while(scanf("%d%d%d", &n, &m, &p) && (n || m || p)){
    sum = 0;
    rep(i, n){
      scanf("%d", x+i);
      sum += x[i];
    }
    sum *= 100;
    sum = sum * (100-p) / 100;

    if(x[m] != 0) printf("%d\n", sum / x[m-1]);
    else puts("0");
  }
  return 0;
}

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

int main(){

  int n, m, p;

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

C++: #include<iostream>
#include<vector>
#include<numeric>
using namespace std;
int main() {
	int n, m;double p;
	while (cin >> n >> m >> p) {
		p /= 100;
		vector<int> x;
		int cnt = 0,y;
		for (int i = 0; i < n; i++) {
			cin >> y;
			x.push_back(y);
		}
		double money = 100*accumulate(x.begin(), x.end(), 0);
		money = money*(1.0 - p);
		if (x[m-1]==0)cout << 0 << endl;
		else cout << (int)(money / x[m-1]) << endl;
	}
	return 0;
}

C++: #include <stdio.h>
#include <vector>
#include <iostream>
#include <string>
using namespace std;

int main(void) {
	vector<int> r;
	while (true)
	{
		int n=0,m=0,p=0;
		scanf("%d %d %d",&n,&m,&p);
		if (n==0 && m==0 && p==0){
			break;
		}
		int ticket=0,winner=0;
		for (int i=0; i<n; i++)
		{
			int x;
			scanf("%d", &x);
			ticket += x;
			if (i == m-1)
			{
				winner = x;
			}
		}
		if (winner != 0)
		{
			r.push_back(ticket*(100-p)/winner);
		} else {
			r.push_back(0);
		}
	}
	for(int i=0; i<r.size(); i++)
	{
		cout << r[i] << endl;
	}
	return 0;
}

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

int main(void){
	int N, M, P;
	int sum, ans;
	int X[1001];

	while((scanf("%d %d %d", &N, &M, &P) != EOF) || (N != 0 || M != 0 || P != 0)){

		sum = 0;
		for(int i = 0; i < N; i++){
			cin >> X[i];
			sum += X[i];
		}

		P = 100 - P;

		if(X[M-1] == 0)	ans = 0;
		else ans = sum * P / X[M-1];

		cout << ans << endl;
	}
  return 0;
}

C++: #include <iostream>

using namespace std;

int main()
{
    int n, m, p;
    int num[101];
    while (cin >> n >> m >> p, n|m|p) {
        int total = 0;
        for (int i = 1; i <= n; i++) {
            cin >> num[i];
            total += num[i] * (100-p);
        }
        if (!num[m]) {
            cout << 0 << endl;
            continue;
        }
        cout << (total / num[m]) << endl;
    }
    return 0;
}

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



int N,M,P;
int X[110];
int g;

int main(){


  while(1){
    cin >> N >> M >> P;
    if(N == 0 && M == 0 && P == 0) break;

    g = 0;

    for(int i = 0 ; i < N ; i ++){
      cin >> X[i] ;
      g += X[i] * 100 - P*X[i];
    }
    if(X[M-1] == 0) cout << "0" << endl;
    else    cout << g/X[M-1] << endl;

  }


  return 0;

}

C++: #include<algorithm>
#include<iostream>
#include<string>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
using namespace std;
int main(){
  int i;
  int m,n,p,q,r,x;
  while(cin>>n>>m>>p&&n+m+p){
    q=0;
    for(i=0;i<n;i++){
      cin>>x;
      q+=x;
      if(i+1==m)
	r=x;
    }
    if(r)
      cout<<q*(100-p)/r<<endl;
    else
      cout<<0<<endl;
  }
  return 0;
}

C++: #include<bits/stdc++.h>
//#include<iostream>
using namespace std;
//type
typedef long long ll;
#define pii pair<int, int>
#define vi vector<int>
//x * y * 1.0 can cause overflow
//constant
#define inf (int)(1e9+7)
#define mod (ll)(1e9+7)
#define eps 1e-10
//omission
#define eb emplace_back
#define F first
#define S second
#define SZ(x) ((int)(x).size())
#define all(v) v.begin(), v.end()
#define ios cin.tie(0); ios::sync_with_stdio(false)
#define FIX(a) cout << fixed << setprecision(a)
#define mp make_pair
//manip
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a = b; return 1; } return 0; }
#define UNIQUE(v) v.erase(unique(v.begin(), v.end(), v.end());
#define fill(x, y) memset(x, y, sizeof(x))
#define ceil(a, b) a / b + !!(a % b)
template<class T> T power_mod(T a, T b) {return b ? power(a * a % inf, b / 2) * (b % 2 ? a : 1) % inf : 1;}
template<class T> T power(T a, T b) {return b ? power(a * a, b / 2) * (b % 2 ? a : 1) : 1;}
#define LB(v, x) (int)(lower_bound(v.begin(), v.end(), x) - v.begin())
#define UB(v, x) (int)(upper_bound(v.begin(), v.end(), x) - v.begin())
template<typename T> T gcd(T a, T b) {if (b == 0) return a; return gcd(b, a % b);}
template<typename T> T lcm(T a, T b) {return a / gcd(max(a, b), min(a, b)) * b;} //先に割る!!
#define outa(a, n) rep(i_, n) cout << a[i_] << " "; cout << endl
#define out(a) cout << a << endl
#define outv(v) rep(i, SZ(v)) cout << v[i] << " "; cout << endl
//loop
#define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define rep3(i, st, n) for (int i = st; i < n; ++i)
//algorithm
//double pointer, l start, how many adds, can be 0 -> init r = l, sum = 0
//bfs, not x, y, i, j
//not !(i % 2), i % 2 == 0
//minimal required terms
//cast caution
//look constraints always



int main() {
    
    
    
    
    int n, m, p;
    
    while (cin >> n >> m >> p && n) {
        int num_people = 0;
        int x[n]; rep(i, n) {cin >> x[i]; num_people += x[i];}
        
        int money = num_people * 100;
        money *= (100 - p) * 0.01;
        //out(money);
        if (x[m - 1] == 0) {
            out(0);
            continue;
        }
        out(money / x[m - 1]);
        
        
        
        
        
    }
    
    
    
    
}

C++: #include <iostream>

using namespace std;

int main(int argc, char const *argv[])
{
	int n,m,p;
	int x;
	int sum;
	int num;

	while(1){
		cin>>n>>m>>p;
		if(n+m+p==0) break;

		sum=0;

		for(int i1=0;i1<n;i1++){
			cin>>x;
			sum+=(x*100);

			if(i1==m-1) num=x;
		}
		sum-=(sum*p/100);

		if(num==0) cout<<0<<endl;
		else cout<<sum/num<<endl;

	}
	return 0;
}

C++: #include <iostream>

using namespace std;

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

int nextInt() { int d; cin >> d; return d; }

int main() {
  while (true) {
    int N = nextInt();
    int M = nextInt() - 1;
    int P = nextInt();

    if (N + M + P == -1) break;

    int sum = 0;
    int xm = 0;
    REP(i, N) {
      int x = nextInt();
      sum += x;
      if (i == M) xm = x;
    }
    if (xm == 0) {
      cout << 0 << endl;
    } else {
      cout << sum * (100 - P) / xm << endl;
    }
   
  }
  return 0;
}