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;
#include <iostream>
/*cout <<"Debug"
cout <<x-30<<' '<<y-30<<endl;
typedef pair<pair<int ,int>, int> P;
vector<pair<pair<int ,int>, int> > v_ans;
vector<int>v_;
vector<long int>v_ansl;
/*taro tenn,hanako_ten,sum*/
/*
bool cmp(P h, P r){
  return h.second < r.second;
}
*/
int v[101];
int main(){
  int N,M;
  int P;

  while(cin >>N>>M>>P){
    if (N == 0 && M == 0 && P == 0) break;
    int NUMP = 0;
    int ans = 0;
    for(int i = 0;i < N ; i++){
      cin >>v[i];
      NUMP += v[i];
    }
    if(v[M-1] == 0){
      ans = 0;
      cout <<ans<<endl;
    }
    else{
    cout <<100*NUMP*(100-P)/(100*v[M-1])<<endl;
  }
  }
  return 0;
}

C++: #include <stdio.h>
int main(){
  int total=0;
  int N,M,P,i,k,h;
  int box[100];
  while(1){
    scanf("%d %d %d",&N,&M,&P);
    if(N==0&&M==0&&P==0) break;
    else{
      total=0;
    for(i=0;i<N;i++){
      scanf("%d",&box[i]);
      total+=box[i]*100;
    }
    k=total*(100-P)/100;
    if(box[M-1]!=0){
    h=k/box[M-1];
    printf("%d\n",h);
    }
    if(box[M-1]==0) 
    printf("0\n");
  }
  }
  return 0;
}

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

using namespace std;

int main(){
	int n, m, p, total, ans;
	while(true){
		cin >> n >> m >> p;
		if(n == 0 && m == 0 && p == 0){
			break;
		}
		vector<int> x(n, 0);	
		for(int i = 0; i < n; i++){
			cin >> x[i];
		}
		total = 0;
		for(int i = 0; i < n; i++){
			total = total + x[i];
		}	
		total = total * 100;
		if(x[m - 1] != 0){
		  ans = (int)(total * (1 - p / 100.0)) / x[m - 1];
		}else{
		  ans = 0;
		}
		cout << ans <<endl;
	}
	return 0;
}

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

int main(int argc, char *argv[])
{
    int n, m, p, x, num, win, total, res;
    while (cin >> n >> m >> p, n | m | p) {
        total = res = 0;
        m--;
        for (int i = 0; i < n; ++i) {
            cin >> x;
            if (i == m)
                win = x;
            total += x;
        }
        if (win != 0)
            res = total * BET * (100 - p) / win / 100;
        cout << res << endl;
    }
    return 0;
}

C++: #include<stdio.h>
#include<stdlib.h>
#include<iostream>
#include<string.h>
#include<math.h>
#include<algorithm>
#include<cstring>
#include<queue>
using namespace std;
#define INF 100000000
int min(int a,int b){
	if(a<b){
		return a;
	}else{
		return b;
	}
}

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

C++: #include <stdio.h>
int main(){
 
  int i,n,m,p,k,x[101];
  int sum,s,re;
  while(1){
    scanf("%d%d%d",&n,&m,&p);
    if(n==0&&m==0&&p==0) break;
    sum=0; 
    for(i=1;i<=n;i++){
      scanf("%d",&x[i]);
      sum+=x[i];
      if(i==m) {
        k=x[i];
      }
    }
    re=(double)100*sum*(100-p)/100;
    if(k!=0)re/=k;
    else re=0;
    //    re=sum*(100-p)/100;
    printf("%d\n",re);
    // s=(double)p/(double)100;
    //re*=s;
    
 
    //  re = sum * p;
 
    // printf("%d\n",re/k);
    /*
   if(k>0){
     re/=k;
     printf("%d\n",(int)re);
    }
    else{
      printf("%d\n",0);
    }
    */
  }
 
  return 0;
}

C++: #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <cmath>
//ranker
using namespace std;

#define REPS(i, a, n) for (int i = (a); i < (n); ++i)
#define REP(i, n) REPS(i, 0, n)
#define RREP(i, n) REPS(i, 1, n + 1)
#define DEPS(i, a, n) for (int i = (a); i >= n; --i)
#define DEP(i, n) DEPS(i, n, 0)

using ll = long long;
using ull = unsigned long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using pii = pair<int, int>;
using pis = pair<int, string>;
using psi = pair<string, int>;
using D = double;


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

  int N, M, P;

  while(1){
  cin >> N >> M >> P;

  if(N==0 && M==0 && P==0) break;

  int X[N];
  int tot = 0;

  REP(i, N){
    cin >> X[i];
    tot += 100*X[i];
  }

  tot = tot*(100-P)/100;

  if(X[M-1] != 0 ) cout << tot/X[M-1] << endl;
  if(X[M-1] == 0) cout << 0 << endl;
}
  return 0;
}

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

int main(){
  int n,m,p;
  double sum;
  double sumg;
  int gold;
  int x[101];

  while(1){
    sum=0;
    sumg=0;
    gold=0;
    cin >> n >> m >> p;
    if(n==0 && m==0 && p==0)break;
    for(int i=0;i<n;i++){
      cin >> x[i];
      sum+=100*x[i];
    }
    sumg=sum-sum*(p*0.01);
    gold=sumg/x[m-1];
    if(x[m-1]!=0){
      cout << gold <<endl;
    }else{
      cout << 0 << endl; 
    }
  }
}

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

int main(){

  int n,m,p;
  int sum;    //maisuu
  int hit;
  int x;
  
  while(cin >> n >> m >> p){
    if(n==0&m==0&&p==0){ break; }

    sum = 0;
    hit=0;


    for(int i=1; i<=n; i++){
      cin >> x;
      sum+=x;
      if(i==m){ hit=x; }
    }

    sum = sum*100 * ((100-p)/100.0);

    // cout << "sum=" << sum << endl;

    if(hit==0)
      cout << 0 << endl;
    else
      cout << sum/hit << 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&&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<iostream>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<utility>
#include<vector>
#include<cmath>
#include<cstdio>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define mp make_pair
#define it ::iterator
#define all(in) in.begin(),in.end()
const double PI=acos(-1);
const double ESP=1e-10;
using namespace std;
int main(){
  int n,m,r;
  while(cin>>n>>m>>r,n||m||r){
    double sum=0;
    vector<int>in(n);
    rep(i,n){cin>>in[i];sum+=in[i];}
    sum*=(100-r);
    if(in[m-1])cout<<(int)(sum/in[m-1])<<endl;
    else cout<<0<<endl;
  }


}

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

using namespace std;

int main()
{
    while (true) {
        int n, m, p;
        cin >> n >> m >> p;
        if (n == 0 && m == 0 && p == 0) {
            return 0;
        }

        vector<int> v;
        for (int i = 0; i < n; ++i) {
            int x;
            cin >> x;
            v.push_back(x);
        }

        auto bet = accumulate(begin(v), end(v), 0) * 100;
        auto remain = bet * (100 - p);
        cout << (v[m - 1] == 0 ? 0 : remain / v[m - 1] / 100) << endl;
    }
}