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;

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

  return 0;
}

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[n - 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>
#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] * 100;
		}
		sum = sum * (1. - (float)p/100);
		if(x[m - 1] == 0){
			ans.push_back(0);
		}else{
			ans.push_back(sum / x[m - 1]);
		}
	}
	for(int i = 0;i < ans.size();i++){
		cout << ans[i] << endl;
	}
}

C++: #include <bits/stdc++.h>
using namespace std;
#define lp(i,n) for(int i=0;i<n;i++)

int main(){
	while(1){
		int n,m,p;
		cin>>n>>m>>p;
		if(n==0&&m==0&&p==0) break;
		int count=0,ans,a;
		lp(i,n){
			cin>>a;
			count+=a;
			if(i==m-1) ans=a;
		}
		count*=100;
		count*=(100-p);
		if(ans!=0)cout<<count/ans/100<<endl;
		else cout<<"0"<<endl;
	}		
	return 0;
}

C++: #include <iostream>
#include <vector>
using std::cin;
using std::cout;
using std::endl;
using std::string;
using std::vector;
#include<iomanip>
using std::setprecision;
int main(){
  int n,m,p;
  int k;
  double d = 0;
  vector<int> v;
  int sum,ans;
  while(cin >> n >> m >> p){
    if(n == 0 && m == 0&& p == 0){
      break;
    }
    sum = 0;
    v.clear();
    for(int i = 0;i < n;i++){
      cin >> k;
      v.push_back(k);
      sum += k*100;
    }
    d = double(p)/100;
    sum = int(sum - sum*d);
    if(v[m-1] == 0){
      ans = 0;
    }else{

      ans = int(sum/v[m-1]);
    }

    cout << ans << endl;

  }
}

C++: #include <algorithm>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <cmath>
#include <cassert>
#include <iostream>
#include <map>
#include <queue>
#include <sstream>
#include <string>
#include <stack>
#include <set>
#include <vector>

using namespace std;

#define all(c) ((c).begin()), ((c).end())
#define dump(c) cerr << "> " << #c << " = " << (c) << endl;
#define iter(c) __typeof((c).begin())
#define tr(i, c) for (iter(c) i = (c).begin(); i != (c).end(); i++)
#define REP(i, a, b) for (int i = a; i < (int)(b); i++)
#define rep(i, n) REP(i, 0, n)
#define mp make_pair
#define fst first
#define snd second
#define pb push_back

typedef long long ll;
typedef vector<int> vi;
typedef vector<double> vd;
typedef pair<int,int> pii;

const int INF = 1 << 29;
const double EPS = 1e-10;


int main() {
  for (int N, M, P; cin >> N >> M >> P, (N | M | P) != 0;) {
    M--;

    int x[100];
    int sum = 0;
    rep(i, N) {
      cin >> x[i];
      sum += x[i];
    }

    if (x[M] == 0) cout << 0 << endl;
    else cout << (int)(sum * (100 - P) / x[M]) << endl;
  }
  
  
  return 0;
}

C++: #include <bits/stdc++.h>
#define range(i, a, b) for(int i = (a); i < (b); i++)
#define rep(i, a) range(i, 0, a)
using namespace std;
const int INF = sizeof(int) == sizeof(long long) ? 1e18 : 1e9;
const int MOD = 1000000007;
const long double EPS = 1e-8;

int main() {
	int n, m, p, va = 0;
	while (cin >> n >> m >> p, n) {
		int x[n], sum = 0;
		rep (i, n) {
			cin >> x[i];
			sum += x[i];
		}
		if (x[m - 1] == 0) {
			cout << 0 << endl;
		} else {
			long long ans = sum * 100.0L * (1.0L - (p / 100.0L)) / x[m - 1] + EPS;
			cout << ans << endl;
		}
	}
	return 0;
}

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

int main() {

while(true){
    int n,m;
    float p;
    cin >> n >> m >> p;
    if(n == 0 && m == 0 && p == 0)break;
    p = (100-p)*0.01;
    
    int x[n+1];
    int sum = 0;
    for(int i = 1;i <= n;i++){
        cin >> x[i];
        sum += x[i];
    }
    int ans = 0;
    ans = sum * 100 * p;
    if(x[m] == 0) ans = 0;
    else ans /= x[m];
    
    cout << ans << "\n";
}
    
return 0;
}

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

using namespace std;

int main() {
  int n, m, p;
  while(cin>>n>>m>>p && !(n==0 && m==0 && p==0)) {
    vector<int> personal;
    //double percentage = (double)p/100.0;
    int total = 0;
    for(int i=0; i<n; i++) {
      int tmp;
      cin>>tmp;
      personal.push_back(tmp);
      total += tmp;
    }
    //cout<<personal[m-1]<<"!";
    //double payBackD = total*(1.0-percentage);
    //int payBackI = (int)payBackD;
    if(personal[m-1] > 0) {
      cout<<(100-p)*total/personal[m-1]<<endl;
    }
    else {
      cout<<"0"<<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;}
//wrong answer

int main(){

  while(1){

	int n,m;
	double p;
	int x[200];
	int ans;
	double 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 * (1-p*0.01) / x[m];
	}

	cout << ans <<endl;

  }

}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
  int n,m,p;
  while(cin>>n>>m>>p,n){
    int sum=0;
    int x[n+1];
    for(int i=1;i<=n;++i){
      cin>>x[i];
      sum+=x[i];
    }
    if(x[m])
      cout<<(int)(100*sum*(1-(double)p/100)/x[m])<<endl;
    else
      cout<<0<<endl;
  }
  return 0;
}

C++: #include "bits/stdc++.h"

using namespace std;
#define rep(i, j) for(int i = 0; i < (j); i++)

int main() {
    while(true) {
        int N, M, P; cin >> N >> M >> P;
        if(N == 0) break;
        vector<int> X(N); rep(i, N) cin >> X[i];
        double sum = 0;
        rep(i, N) sum += X[i] * 100;
        double sub = sum * P / 100.0;
        sum -= sub;
        cout << (X[M - 1] == 0 ? 0 : int(sum / X[M - 1])) << endl;
    }
}