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 <cstdio>

int main()
{
	int N, M, P;
	while (scanf("%d %d %d", &N, &M, &P) != EOF) {
		if (N == 0 && M == 0 && P == 0)
			break;
		
		int sum = 0, m = 0, t;
		for (int i = 0; i < N; ++i) {
			scanf("%d", &t);
			sum += t;
			if (i == (M-1))
				m = t;
		}

		sum *= 100 * ((100 - P) / 100.0);
		if (m == 0)
			printf("0\n");
		else
			printf("%d\n", sum/m);
	}
	return 0;
}

C++: #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep1(i, n) for (int i = 1; i < (n); i++)
#define all(v) (v).begin(), (v).end()
#define pb(a) push_back(a)
#define mp(a, b) make_pair(a, b)
using namespace std;
typedef long long LL;
const int INF = 999999999;

int main(){
    int n,m,p;
    cin >> n >> m >> p;
    while(n > 0){
        vector<int> x(n);
        rep(i, n) cin >> x[i];
        int sum = accumulate(all(x), 0);
        if(x[m-1] == 0) cout << 0 << endl;
        else cout << sum*(100-p)/x[m-1] << endl;
        cin >> n >> m >> p;
    }

}

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

int main(void){
	int N, M, P;
	while(scanf("%d %d %d", &N, &M, &P) != EOF && (N != 0 && M != 0 && P != 0)){
		int sum = 0;
		int *X = new int[N];
		for(int i = 0; i < N; i++){
			scanf("%d", X+i);
			sum += X[i];
		}
		if(X[M-1] == 0){
			printf("%d\n", 0);
		}else{
			printf("%d\n", (int)((sum * (100 - P)) / X[M-1]));
		}
	}
  return 0;
}

C++: #include <bits/stdc++.h>
#define For(i, a, b) for(int (i)=(a); (i)<(b); ++(i))
#define rFor(i, a, b) for(int (i)=(a)-1; (i)>=(b); --(i))
#define rep(i, n) For((i), 0, (n))
#define rrep(i, n) rFor((i), (n), 0)
#define fi first
#define se second
using namespace std;
typedef long long lint;
typedef unsigned long long ulint;
typedef pair<int, int> pii;
typedef pair<int, lint> pil;
typedef pair<lint, int> pli;
template<class T>bool chmax(T &a, const T &b){if(a<b){a=b; return true;} return false;}
template<class T>bool chmin(T &a, const T &b){if(a>b){a=b; return true;} return false;}

constexpr lint mod = 1e9+7;
constexpr lint INF = mod*mod;
constexpr int MAX = 100010;

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

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

int main(){
  while(true){
    int n,m,p;
    scanf("%d%d%d",&n,&m,&p);
    if(n+m+p==0)return 0;
    int sum = 0;
    int win = 0;
    for(int i=0;i<n;i++){
      int x;
      scanf("%d",&x);
      sum += x;
      if(i==m-1)win = x;
    }
    sum *= 100;
    p = 100 - p;
    // ans = sum * p / 100 / win
    if(win == 0){
      puts("0");
    }else{
      int ans = sum * p / (100 * win);
      printf("%d\n",ans);
    }
  }
}

C++: #include <bits/stdc++.h>
using namespace std;
#define int long long   // <-----!!!!!!!!!!!!!!!!!!!

#define rep(i,n) for (int i=0;i<(n);i++)
#define rep2(i,a,b) for (int i=(a);i<(b);i++)
#define rrep(i,n) for (int i=(n)-1;i>=0;i--)
#define rrep2(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define all(a) (a).begin(),(a).end()

typedef long long ll;
typedef pair<int, int> P;

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

    int n, m, p;
    while (cin >> n >> m >> p, n) {
        vector<int> x(n);
        rep(i, n) cin >> x[i];
        int sm = accumulate(all(x), 0);
        cout << (x[m-1] == 0 ? 0 : sm * (100 - p) / x[m-1]) << endl;
    }

}

C++: #include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <numeric>
#include <functional>
#include <math.h>
#include <stdio.h>
using namespace std;
int main(){
	int n,m,p;
	while(cin>>n>>m>>p,n||m||p){
		int num,sum=0;;
		for(int i=0;i<n;i++){
			int x;
			cin>>x;
			sum+=x;
			if(i==m-1){
				num=x;
			}
			
		}
		sum*=100;
		sum=sum*(100-p)/100;
		
		if(num==0){
			cout<<0<<endl;
		}else{
			cout<<sum/num<<endl;
		}
	}
	return 0;
}

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;
    double percent, sumMoney;
    int vote[1005];
    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;
        }
        sumMoney*= percent / 100;
        if(vote[winNum] != 0)
            cout << static_cast<int>(sumMoney) / vote[winNum] << endl;
        else
            cout << 0 << endl;
    }
}

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

using namespace std;

int main(){
    while(true){
        // N, M, P ?????\???
        int n, m, p;
        cin >> n >> m >> p;

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

        //x ?????\???
        vector<int> x(n);
        for(auto &a:x)
            cin >> a;

        // ????????????????????????
        if(x[m - 1] == 0){
            cout << 0 << endl;
            continue;
        }

        //????¨??????????
        int sum = accumulate(x.begin(), x.end(), 0) * 100;
        //?????????????????????
        double total = sum * (100 - p) / 100;
        //????????????
        int money = total / x[m - 1];

        cout << money << endl;
    }

    return 0;
}

C++: #include <iostream>
#define REP(i, a, n) for(int i = (a); i < (n); i++)
using namespace std;

int N, M, P, A[100];
int sum;

int main(void) {
  while(cin >> N >> M >> P, N || M || P) {
    REP(i, 0, N) cin >> A[i];

    sum = 0;
    REP(i, 0, N) sum += A[i];

    if(A[M - 1] > 0) {
      int ans = (double) 100 * sum * (100 - P) / (100 * A[M - 1]);
      cout << ans << endl;
    } else {
      cout << 0 << endl;
    }
  }
  
  return 0;
}

C++: #include<iostream>
#include<iomanip>
#include<math.h>
#include<algorithm>
#include<string>
#include<string.h>
#include<vector>
#include<queue>
#include<stack>
#include<set>
#include<map>
#include<complex>
#define REP(i, N) for(ll i = 0; i < N; ++i)
#define FOR(i, a, b) for(ll i = a; i < b; ++i)
#define ALL(a) (a).begin(),(a).end()
#define pb push_back
#define INF (long long)1000000000
#define MOD 1000000007
#define EPS (long double) 1e-8
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
int dh[4] = {1, 0, -1, 0};
int dw[4] = {0, 1, 0, -1};

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