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 <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <cmath>
#include <string>
#include <sstream>
#include <iomanip>
#include <complex>

using namespace std;


#define ll long long
#define vvi vector< vector<int> >
#define All(X) X.begin(),X.end()
#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define pb push_back 
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}
//wrong answer

int main(){

  while(1){

	int n,m,p;
	int x[200];
	int ans;
	int sum=0;

	cin >> n >> m >> p;

	if(n==0&&m==0&&p==0)
	  break;

	m--;

	REP(i,n){
	  cin >> x[i];
	  sum += x[i];
	}

	sum = sum * 100;
	if(x[m]==0){
	  ans = 0;
	}else{
	  ans = (sum / x[m]) * (1-p*0.01);
	}

	cout << ans <<endl;

  }

}

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

int main() {
  while(1){
    int n, m, p;
    cin >> n;
    cin >> m;
    cin >> p;
    int sum = 0;
    int s;
    int win;

    if(n == 0 && m  == 0 && p == 0)
      return 0;

    for(int i = 1; i <= n; i++){
      cin >> s;
      sum += s;
      if(i == m)
        win = s;
    }
    if(win != 0)
      cout << (int)(((100 * sum) * (100 - p) / 100) / win) << "\n";
    else
      cout << 0 << "\n";
  }
}

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

using namespace std;

long long INF=1e15;

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

    while(1){
        int n,m,p;
        cin>>n>>m>>p;

        if(n==0)break;

        int sum=0;
        vector<int> a(n);
        for(int i=0;i<n;i++){
            cin>>a[i];
            sum+=a[i];
        }

        sum*=(100-p);

        if(a[m-1]==0)sum=0;
        else sum/=a[m-1];

        cout<<sum<<endl;
    }
}

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

using namespace std;

int main()
{
  int n_player, winner;
  double P;
  while (scanf(" %d %d %lf", &n_player, &winner, &P) == 3) {
    if (n_player == 0 && winner == 0 && P == 0) break;
    winner--;
    //cout << "winner = " << winner << endl;
    int table[n_player];
    double money = 0;
    for (int i = 0; i < n_player; i++) {
      scanf(" %d", &table[i]);
      money += table[i] * 100;
    }
    if (table[winner] == 0) {
      cout << 0 << endl;
      continue;
    }
    //cout << "money = " << money << endl;
    money -= money * (double)(P/100);
    //cout << (double)(P/100) << endl;
    //cout << "money2 = "  << money << endl;
    cout << (int)(money / table[winner]) << endl;
  }
  return 0;
}

C++: #include <iostream>

using std::cin;
using std::cout;
using std::endl;

int main(void) {
	int N,M,P;
	
	cin >> N;
	cin >> M;
	cin >> P;

	while (N != 0 || M != 0 || P != 0) {
		int vote;
		int vote_w;
		int sum_vote = 0; 
		double r;
		for (int i = 0; i < N; i++) {
			cin >> vote;
			sum_vote += vote;
			if (i+1 == M) {
				vote_w = vote;
			} 
		}
		if (vote_w > 0) {
			r = ((sum_vote*100)/vote_w) * (1-(double)P/100);
		}else {
			r = 0;
		}
		cout << (int)r << endl; 
		
		cin >> N;
		cin >> M;
		cin >> P;
	}
	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>
#include <algorithm>

using namespace std;

int main(){
	while(true){
		int n;//競技者の数
		int m;//優勝した競技者の番号
		int p;//掛け金すべてプールされた後の控除率
		cin >> n >> m >> p;
		if(n==0 && m == 0 && p == 0){
			break;
		}
		int allcnt = 0;//投票したすべての枚数
		int viccnt = 0;//当選した枚数
		for(int i=0;i<n;i++){
			int num;//i+1番目の競技者にかけた人数
			cin >> num;
			allcnt += num;
			if(i+1 == m){
				viccnt += num;
			}
		}
		int result;
		if(viccnt == 0){
			result = 0;
		}else{
			int pool = 100 * allcnt * (100 - p) /100;//控除後のプールされたお金
			result = pool/viccnt;
		}
		cout << result << endl;
	}
	return 0;
}

C++: // 2016-11-25
#include <iostream>

int main() {
	int n, m, p;
	int x[100];
	int s;
	float a;
	std::cin >> n >> m >> p;
	while (n || m || p) {
		s = 0;
		for (int i = 0; i < n; i++) {
			std::cin >> x[i];
			s += x[i];
		}
		if (x[m - 1] == 0) {
			std::cout << 0 << std::endl;
		} else {
			a = 100 * s;
			a *= (1.0 - 0.01 * p);
			a /= x[m - 1];
			std::cout << (int)a << std::endl;
		}
		std::cin >> n >> m >> p;
	}
	return 0;
}

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

using namespace std;

vector<int> ans;
int n,m,p;
int main(){
	while(1){
		cin >> n >> m >> p;
		if(n == 0 && m == 0 && p == 0) break;
		int prize = 0;
		int x[100];
		int sum = 0;
		for(int i = 0;i < n; i++){
			cin >> x[i];
			sum += x[i];
		}
		if(x[m - 1] == 0){
			ans.push_back(0);
		}else{
			ans.push_back(sum *(100 - p)/x[m - 1]);
		}
	}
	for(int i = 0;i < ans.size();i++){
		cout << ans[i] << endl;
	}
}

C++: #include<stdio.h>
#include<iostream>
#include<list>
#include<map>
#include<math.h>
#include<vector>
#include<algorithm>
#include<string.h>
#include<iomanip>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) range(i,0,b)
#define debug(x) cout << "debug" << x << endl;
using namespace std;

int main(){
    int person, winNum, percent;
    int vote[1005], sumMoney;
    while(cin >> person >> winNum >> percent, person || winNum || percent){
        percent = 100 - percent;
        sumMoney = 0;
        range(i, 1, person + 1){
            cin >> vote[i];
            sumMoney+= vote[i] * 100;
        }
        if(vote[winNum] != 0)
            cout << (sumMoney * percent / 100) / vote[winNum] << endl;
        else
            cout << 0 << endl;
    }
}

C++: #include <iostream>
#include <vector>
#include <string>
#include <sstream>
#include <algorithm>
#include <map>
#include <set>
#include <cstdio>
#include <cmath>
#define rep(i,l,n) for(lint i=l;i<n;i++)
#define rer(i,l,n) for(lint i=l;i<=n;i++)
#define all(a) a.begin(),a.end()
#define o(a) cout<<a<<endl
#define pb(a) push_back(a)
#define mk(a,b) make_pair(a,b)
#define fi first
#define se second
using namespace std;
typedef long long lint;
typedef vector<int> vi;
typedef vector<lint> vli;
typedef vector<vi> vvi;
typedef pair<int,int> pii;

int main(){
	int n,m,p;
	while(1){
		cin>>n>>m>>p;
		if(n+m+p==0) break;
		int sum=0,win;
		rep(i,1,n+1){
			int a;
			cin>>a;
			sum+=a;
			if(i==m) win=a;
		}
		o((win==0?0:p*sum/win));
	}
}

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

int main(){
	while(true){
		int n,m,p,sum = 0;
		cin >> n >> m >> p;
		if(n == 0) return 0;
		int a[105] = {0};
		for(int i = 1; i <= n; i++){
			cin >> a[i];
			sum += a[i];
		}
		int pr = sum * (100-p);
		if(a[m] != 0) cout<<pr / a[m] <<endl;
		else cout<<"0"<<endl;
	}
}

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

int main(){
	int N, M, P, X;
	int i;
	double rate, sum;
	
	cin >> N >> M >> P;
	while(N!=0 || M!=0 || P!=0){
		vector<int> v;
		sum=0.0;
		rate=(100-P)/100.0;
		
		for(i=0; i<N; ++i){
			cin >> X;
			sum+=100*X;
			v.push_back(X);
		}
		sum*=rate;
		
		if(v[M-1]==0) cout << 0 << endl;
		else cout << (int)sum/v[M-1] << endl;
		
		cin >> N >> M >> P;
	}
	return 0;
}