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>
using namespace std;

int main(){

  int n,m,p;
  double 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;

    if(hit==0)
      cout << 0 << endl;
    else
      cout << (int)(sum/hit) << endl;

  }

  return 0;
}

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);
		cout<<count/a/100<<endl;
	}		
	return 0;
}

C++: #include <sstream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <iostream>
#include <utility>
#include <set>
#include <cctype>
#include <queue>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
using namespace std;
#define INF 100000000
typedef long long ll;

int main(void) {
    int N, M, P;
    while (cin >> N >> M >> P && N && M && P) {
        int X[N+1], sum = 0;
        for (int i = 1; i <= N; i++) {
            cin >> X[i];
            sum += X[i];
        }
        if (X[M] == 0) {
            cout << 0 << endl;
            continue;
        }
        cout << (int)(100 * sum * (1-1.0*P/100) / X[M]) << endl;
    }
    return 0;
}

C++: #include<iostream>
using namespace std;
int main() {
	int n;
	int m;
	int p;
	int answer=0;
	int x[1000];
	while (1) {
		cin >> n;
		cin >> m;
		cin >> p;
		
		if (n == 0 && m == p && p == 0) {
			break;
		}

		for (int i = 0; i < n; i++) {
			cin >> x[i];
			answer += x[i];
		}
		if (x[m - 1 ]!= 0) {
			answer = (answer*(100- p)) / x[m - 1]; 
		}
		else {
			answer = 0;
		}
		cout << answer<<endl;

	}
}

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

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<ll, ll> P;

#define EACH(i,a) for (auto& i : a)
#define FOR(i,a,b) for (ll i=(a);i<(b);i++)
#define RFOR(i,a,b) for (ll i=(b)-1;i>=(a);i--)
#define REP(i,n) for (ll i=0;i<(n);i++)
#define RREP(i,n) for (ll i=(n)-1;i>=0;i--)
#define debug(x) cout<<#x<<": "<<x<<endl
#define pb push_back
#define ALL(a) (a).begin(),(a).end()

const ll linf = 1e18;
const int inf = 1e9;
const double eps = 1e-12;
const double pi = acos(-1);

template<typename T>
istream& operator>>(istream& is, vector<T>& vec) {
	EACH(x,vec) is >> x;
	return is;
}
/*
template<class... T>
ostream& operator<<(ostream& os, tuple<T...>& t) {
	for (size_t i = 0; i < tuple_size< tuple<T...> >::value; ++i) {
		if (i) os << " ";
		os << get<0>(t);
	}
	return os;
}
*/
template<typename T>
ostream& operator<<(ostream& os, vector<T>& vec) {
	REP(i,vec.size()) {
		if (i) os << " ";
		os << vec[i];
	}
	return os;
}
template<typename T>
ostream& operator<<(ostream& os, vector< vector<T> >& vec) {
	REP(i,vec.size()) {
		if (i) os << endl;
		os << vec[i];
	}
	return os;
}

int main() {
	std::ios::sync_with_stdio(false);
	std::cin.tie(0);
	int N, M, P;
	while (cin >> N >> M >> P, N || M || P) {
		vector<int> X(N); cin >> X;
		int sum = 0;
		REP(i, N) sum += X[i];
		sum *= 100;
		sum -= sum * P / 100;
		int ans;
		if (X[M-1] == 0) ans = 0;
		else ans = sum / X[M-1];
		cout << ans << endl;
	}
}

C++: #include <iostream>
using namespace std;
int main(){
  int n,m,p,sum=0;

  while(cin >> n >> m >> p && n&&m&&p){
    int num[n];
    for(int i=0; i<n; i++){
      cin >> num[i];
      sum+=num[i];
    }
    sum *= p;
    cout << sum/num[m-1] << endl;
  }
}

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

int main(){
	int N,M,P;

	while(1){
		cin >> N >> M >> P;
		if ((N == 0)&&(M == 0)&&(P == 0)){
			break;
		}

		double A[N];
		double sum = 0;
		double num = 0;
		double money;
		for (int i = 1; i <= N; i++){
			cin >> A[i];
			sum += A[i]*100;
			if (i == M){
				num = A[i];
			}
		}
		
		money = (sum*(100 - P)/100)/num;
		//cout << M << " " << num << " " << sum << " " << money << " " << P << endl;

		if (num == 0){
			cout << 0 << endl;
		} 
	else if (num != 0){
		cout << (int)money << endl;
	 }
	}
}

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

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

    cin >> n >> m >> p; 
  }
}

C++: #include<iostream>
#include<map>
#include<vector>
#include<string>
#include<cmath>
#define rep(i, n) for(int i=0; i<n; i++)
#define rrep(i, n) for(int i=n-1; i>=0; i--)
#define FOR(i, a, b) for(int i=a; i<b; i++)
#define rFOR(i, a, b) for(int i=b-1; i>=a; i--)
#define MAX 100
using namespace std;
typedef long long ll;

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

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

C++: #include <sstream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <iostream>
#include <utility>
#include <set>
#include <cctype>
#include <queue>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
using namespace std;
#define INF 100000000
typedef long long ll;

int main(void) {
    int N, M, P;
    while (cin >> N >> M >> P && N && M && P) {
        int X[N+1], sum = 0;;
        for (int i = 1; i <= N; i++) {
            cin >> X[i];
            sum += X[i];
        }
        if (X[M] == 0) {
            cout << 0 << endl;
            continue;
        }
        cout << (int)(100 * sum * (1-1.0*P/100) / X[M]) << endl;
    }
    return 0;
}

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

using namespace std;

int main(){

  int n,m,p;

  while(cin>>n>>m>>p,n||m||p){

	vector<int> x(n+1);
	int total=0;
	
	for(int i=1;i<=n;++i){
	  cin>>x[i];
	  total+=x[i];
	}
	
	total=total*(100-p);
	
	if(x[m]==0)
	  cout<<0<<endl;
	else{
	  double tmp = total/x[m];
	  cout<<(int)total<<endl;
	}
  }

}