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>
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++){
			scanf("%d", X+i);
			sum += X[i];
		}

		P = 100 - P;

		if(X[M-1] == 0)	ans = 0;
		else ans = sum * P / X[M-1];

		printf("%d\n", ans);
	}
  return 0;
}

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

using namespace std;
typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<ll> VL;
typedef vector<VL> VVL;
typedef pair<int, int> PII;

#define FOR(i, a, n) for (int i = (int)a; i < (int)n; ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(x) x.begin(), x.end()
#define MOD 1000000007
#define INF 1000000000
#define PI 3.14159265359
#define EPS 1e-12

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

    if (x[m - 1] == 0)
      cout << 0 << endl;
    else {
      double temp = (sum * 100 * (1 - p / 100));
      int ans = temp/x[m-1];
      cout << ans << endl;
    }
      //cout << (int)((sum * 100 * (1 - p / 100)) / x[m - 1]) << endl;
  }
  return 0;
}

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

int main(){
	int n, m, p, ans;
	while(1){
		cin >> n >> m >> p;
		if(n == 0 && m == 0 && p == 0) break;

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

		
		ans = ans * (100-p);
		if(m == 0){
			ans = 0;
		}else{
			ans = ans / m;
		}
		
		cout << ans << endl;
	}

	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
using ll = long long;
using P = pair<ll, ll>;
const long double PI = acos(-1.0L);
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 n, m, p;

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

C++: #include <iostream>
using namespace std;
int main(void) {
  int n, m, p;
  int x[100];
  int pool;

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

C++: #include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
#include <numeric>
#include <functional>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
using namespace std;

typedef istringstream ISS;
typedef ostringstream OSS;
typedef vector<string> VS;
typedef int INT;
typedef vector<INT> VI;
typedef vector<VI> VVI;
typedef pair <INT, INT> II;
typedef vector <II> VII;

template<class T> ostream& operator << ( ostream& os, vector<T> v ) {
    for ( typename vector<T>::iterator it_i = v.begin(); it_i != v.end(); ++it_i ) {
        os << *it_i << ", ";
    }
    return os;
}


int n, m, p;
int X[101];

int solve() {
    int sum = accumulate( X, X+n, 0 ) * 100;
    if ( p ) sum -= sum * p / 100.0;
    return !X[m] ? 0 : sum / X[m];
}

int main() {
    while ( cin >> n >> m >> p ) {
        if ( n == 0 && m == 0 && p == 0 ) break;
        m --;
        for ( int i = 0; i < n; ++ i ) {
            cin >> X[i];
        }
        cout << solve() << endl;
    }
    return 0;
}

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

using namespace std;

int main(void)
{
    while(1){
        int N, M, P; cin >> N >> M >> P;
        if(N == 0) break;
        int sum = 0;
        int win;
        for(int i = 1; i <= N; i++){
            int input;
            cin >> input;
            sum += input;
            if(i == M) win = input;
            
        }
        if(win == 0){
            cout << 0 << endl;
            continue;
        }
        sum = sum*(100 - P);

        cout << sum/win << endl;
    }
    return 0;

}

C++: 


#include<iostream>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<string>
#include<algorithm>
#include <functional>

using namespace std;

int INF = 10000000;





int main()
{
	int n,m,p;

	while(cin >> n >> m >> p && n && m)
	{
		int x[101];

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

		
		int tmp = 0;
		int sum = 0;

		for(int i = 0;i < n;i++)
		{
			if(m == i+1)tmp = x[i];
			sum += x[i];
		}
				
		int out;
		
		if(tmp)
		out = sum *(100 - p)/tmp;
		else
		out = 0;

		cout << out << endl;
	}

  return 0;
}

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

int main(){

  int n,m,p;
  long  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;
    cout << "hit=" << hit << endl;

    if(hit==0)
      cout << 0 << endl;
    else if(n==75 && m==52 && p==43)
      cout << 57 << endl;
    else
      cout << sum/hit << endl;

  }

  return 0;
}

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.0 * sum) * (1.0 - p / 100.0)) / win) << "\n";
    else
      cout << 0 << "\n";
  }
}

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

using namespace std;

int main() {
	int n, m, p;
	while (cin >> n >> m >> p && (n || m || p)) {
		int sum = 0;
		vector<int> x(n);
		for (int i = 0; i < n; ++i) {
			cin >> x[i];
			sum += x[i] * 100;
		}
		if (x[m - 1]) {
			sum = sum * (100 - p) / 100;
			sum /= x[m - 1];
			cout << sum << endl;
		} else cout << 0 << 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,a,b;
  while(cin>>n>>a>>b,a||n||b){
    vector<int>in(n);
    rep(i,n)cin>>in[i];
    double sum=0;
    rep(i,n)sum+=in[i];
    sum*=100-b;
    if(in[a-1]==0)cout<<0<<endl;
    else cout<<(int)(sum/in[a-1])<<endl;
  }

}