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 <stdio.h>
#include <stdlib.h>
int compare_int(const void *a, const void *b) {
       return *(int*)a - *(int*)b;
}
int main(void) {
   int n, m;
   // n は区間の数。mは予算。
   int i;
   while (1) {
      scanf("%d %d", &n, &m);
      if (n==0 && m==0) break;
      int d[n]; // 区間の数だけ距離の配列。中には距離が入る
      int p[n]; // 襲われる回数の期待値の配列。中には区間ごとの期待値が入る。
      
      for (i=0; i<n; i++) 
         scanf("%d %d", &d[i], &p[i]);
      // ここで、距離の配列と期待値の配列がそれぞれ埋まっている。
      qsort(p, n, sizeof(int), compare_int);
      // 小さい順に並んでいます
      int temp;
      for ( i=0; i< (n/2); i++) {
         temp = p[i];
         p[i] = p[ n-1-i ];
         p[ n-1-i ] = temp;
      }
      // 昇順に入れ替えた。
      
      for (i=0; i<m; i++)
         p[i] = 0;
      int goukei = 0;
      for (i=0; i<n; i++)
         goukei += p[i];
      printf("%d\n", goukei);
   }
   return (0);
}

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

int main(void){
	int n, m, p, cnt, x, sum;
	while(true){
		cin >> n >> m >> p;
		if(!n&&!m&&!p) break;
		cnt = 0; sum = 0;
		for(int i = 0; i < n; ++i){
			cin >> x;
			sum += x;
			if(i == m-1) cnt = x;
		}
		if(cnt == 0){
			cout << 0 << endl;
			continue;
		}
		cout << sum * (100 - p) / cnt << 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];
    }

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

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

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

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

int main(){
  int i,n,m,p,x[1001],total;


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

    for( i = 1; i <=1000; i++){
      x[i]=0;
    }

    for( i = 1; i <= n; i++){
      cin >> x[i];
      total += x[i];
    }
    total*=100;
      
    if(x[m]>0){
      total /= x[m];

      total = total * (100- p) /100;
      cout << total << endl;
    }else if(x[m]==0){
      cout << 0 << endl;
    }
  }
  return 0;
}

C++: #define _CRT_SECURE_NO_WARNINGS // #pragma warning(disable:4996)
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>
#include <string>
#include <queue>
#include <functional>
#include <sstream>
#include <cmath>
#include <set>
#include <map>
using namespace std; 

#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define pb push_back
#define mp(a,b) make_pair(a,b)
#define all(a) a.begin(),a.end()
#define len(x) ((int)(x).size())
#define tmax(a,b,c) max((a),max((b),(c)))
#define tmin(a,b,c) min((a),min((b),(c)))
#define debug(x) cerr << #x << " is " << x << endl;

typedef pair<int, int> Pii;
typedef vector<int> Vi;
typedef vector<vector<int> > VVi;
typedef long long ll;
const int inf = 2e9;
const ll ll_inf = 1e17;
const int mod = 1e9 + 7;
const long double eps = 1e-10;

int a[101];

int main()
{
	while(1) {
		int n, m, p;
		cin >> n >> m >> p;
		if (!n && !m && !p) break;
		int sum = 0, cnt = 0;
		rep(i,0,n) {
			cin >> a[i];
			sum += (100 - p) * a[i];
			cnt += a[i];
		}
		m--;
		if (!a[m]) {
			cout << 0 << endl;
			continue;
		}

		cout << floor((double)sum / a[m]) << 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) * (1-(double)P/100)) /vote_w;
		}else {
			r = 0;
		}
		cout << (int)r << endl; 
		
		cin >> N;
		cin >> M;
		cin >> P;
	}
	return 0;
}

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

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

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

  while(true) {
    int N, M, P;
    cin >> N >> M >> P;
    if(N + M + P == 0) break;

    int sum = 0;
    int a;
    int X[1010];
    rep(i, N) {
      cin >> a;
      X[i] = a;
      sum += X[i];
    }
    if(X[M - 1] == 0) {
      cout << 0 << endl;

      continue;
    }
    sum = sum * 100;

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

    sum = sum / X[M - 1];

    cout << sum << endl;
  }
}

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;}

int main(){
	while(1){
		int n,m,p;
		cin >> n >> m >> p;
		if(n==0&&m==0&&p==0) break;
		ll int sum = 0;
		ll int ans;
		REP(i,n){
			int tmp;
			cin >> tmp;
			sum += tmp;
			if(i==m-1) ans = tmp;
		}
		if(ans!=0) ans = sum*(100-p)/ans;
		cout << ans << endl;
	}
}

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

using namespace std;

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

	int n, m, p;
	int j = 0;
	vector<int>ans(10000000);

	while(1){
		cin >> n >> m >> p;
		if (n == 0 && m == 0 && p == 0)
			break;
		long long sum = 0;

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

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

	} 

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

C++: #include <iostream>
#include <vector>
using namespace std;
int main(){
	int N, M, P;
	while( 1 ){
		//cout << "N M P" <<endl;
		cin >> N >> M >> P;
		int money = 0;
		vector<int> X(N);
		if( N == 0 && M == 0 && P == 0 ) break;
		for( int i = 0; i < N; i++ ){
			cin >> X[i];
			money += X[i];
		}
		if( X[M-1] == 0 ){
			cout << 0 << endl;
		}else{
			money *= (double)(100 - P) / (double)X[M-1];
			cout << (int)money << endl;
		}
	}
}

C++: #include <iostream>

using namespace std;

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