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;

int main(){
  int N,M,P,X[1000];
  double kazu=0,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){
        cout<<0<<endl;
      }else{
        kane=kazu*100;
        kane*=(1.0-P*0.01);
        kane=kane/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 "bits/stdc++.h"

using namespace std;

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);

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

C++: #include<iostream>
#include<vector>
#include<string>
#include<cmath>
#include<algorithm>
#include<set>
using namespace std;
int main() {
	int n, p, m;
	while (cin >> n >> p >> m&&n != 0) {
		double sum , x,parson;
		double  a = 0;
		for (int i = 0; i < n; i++) {
			cin >> x;
			a += x;
			if (i == p - 1) parson = x;
		}
		sum = ((a * 100 * (100 - m ))/ 100);
		if (parson == 0) cout << 0 << endl;
		else cout << floor(sum/parson) << endl;
	}
}

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

struct Game {
    int M;
    int N;
    int P;
    std::vector<int> betNum;
};

void cost(Game game); 

int main(void) {
    int M;
    int N;
    int P;
    do {
        Game game;
        std::cin >> game.M >> game.N >> game.P;

        if (game.M == 0 && game.N == 0 && game.P == 0) {
            break;
        }

        for (int i = 0; i < game.M; i++) {
            int num;
            std::cin >> num;
            game.betNum.push_back(num); 
        }
        cost(game);

    } while (1);
    return EXIT_SUCCESS;
}

void cost(Game game) {
    int total = 0;
    std::vector<int> v = game.betNum;
    for (int i = 0; i < (int)(v.size()); i ++) {
        total += v[i]; 
    }
    int winner = v[game.N - 1];
    if (winner == 0) {
        std::cout << "0" << std::endl;
    } else {
        std::cout << 100 * total * (100 - game.P) / 100 / winner << std::endl;
    }
    return;
}

C++: #include<iostream>
#include<map>
#include<vector>
#include<algorithm>
#include<cmath>
#include<climits>
#include<ctime>
#include<cstring>
#include<numeric>

#define ALL(v) (v).begin(),(v).end()
#define REP(i,p,n) for(int i=p;i<(int)(n);++i)
#define rep(i,n) REP(i,0,n)
#define dump(a) (cerr << #a << "=" << (a) << endl)
#define DUMP(list) cout << "{ "; for(auto nth : list){ cout << nth << " "; } cout << "}" << endl;

using namespace std;

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

	while(cin >> N >> M >> P)
	{
		vector<int> athlete(N,0);
		if(N==0 && M==0 && P==0){ break; }
		rep(i,N){ cin >> athlete[i];}

		int total = accumulate(ALL(athlete),0)*100;
		int gold = total - ((total*P)/100);
	
		int ans;
		if(athlete[M-1] == 0){
			ans = 0;
		}else{
			ans = gold / athlete[M-1];
		}
		cout << ans << endl;

	}
	return 0;
}

C++: #include <bits/stdc++.h>

int main() {
    for(;;) {
        int n, m, p;
        std::cin >> n >> m >> p;
        if (n == 0 && m == 0 && p == 0) {
            break;
        }
        std::vector<int> xs(n);
        for(int i = 0; i < n; ++i) {
            std::cin >> xs[i];
        }
        int sum = 0;
        for(int x : xs) {
            sum += x;
        }
        if (xs[m-1] == 0) {
            printf("0\n");
        }
        else {
            int res = sum * (100 - p) / xs[m-1];
            printf("%d\n", res);
        }
    }
}

C++: #include<bits/stdc++.h>
using namespace std;
using ll = int64_t;
int main(){
    while(1){
        ll N, M, P;
        cin >> N >> M >> P;
        if(!N && !M && !P) break;
        M--;
        ll po[N];
        for(ll i = 0; i < N; i++) cin >> po[i];
        ll yo = 0;
        for(ll i = 0; i < N; i++) yo += po[i];
        yo *= 100;
        cout << (po[M] ? (int)(yo * (1 - (double)P / 100) / po[M]) : 0) << endl;
    }
    return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <string>
#include <algorithm>

using namespace std;

int main (int argc, char *argv[]) {
    int n, m, p;
    int x[100];
    while (cin>>n>>m>>p, n||m||p) {
        int total = 0;
        for (int i = 0; i < n; ++i) {
            cin>>x[i];
            total += x[i];
        }
        if (x[m-1] == 0) cout<<"0"<<endl;
        else cout << int(100 * total * (1.0 - p/100.0) / x[m-1]) << endl;
    }
    return 0;
}

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

int main() {
	int n, m, p, x[101],k=0, ans[101];

	while (true) {
		int sum = 0;
		cin >> n >> m >> p;

		if (n == 0) {
			if (m == 0) {
				if (p == 0) {
					break;
				}
			}
		}

		for (int i = 1; i <= n; i++) {
			cin >> x[i];
			sum = sum + x[i];
		}
		sum = sum*(100-p);
		

		if (x[m] != 0) {
			sum = (int)sum / x[m];
			ans[k] = sum;
			k++;
		}

		else {
			ans[k] = 0;
			k++;
		}

	}
	for (int i = 0; i < k; i++)
		cout << ans[i] << endl;
}

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] * 100;
    }
    pool *= (100-p) / 100.0;
    if(x[m-1] != 0){
      cout << (int)(pool / x[m-1])<<endl;
    }
    else{
      cout << 0 << endl;
    }
  }
  return 0;
}