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;
#include <iostream>
/*cout <<"Debug"
cout <<x-30<<' '<<y-30<<endl;*/
typedef pair<pair<int ,int>, int> P;
vector<pair<pair<int ,int>, int> > v_ans;
vector<int>v_;
vector<long int>v_ansl;
/*taro tenn,hanako_ten,sum*/

bool cmp(P h, P r){
  return h.second < r.second;
}
int v[101];
int main(){
  int N,M;
  float P;

  cin >>N>>M>>P;
  while(N!=0 and M!=0 and P!=0){
    long int NUMP = 0;
    int ans = 0;
    for(int i = 0;i < N ; i++){
      cin >>v[i];
      NUMP += v[i];
    }
    NUMP *= (100-P);
    if(v[M-1] == 0){
      ans = 0;
      cout <<(int)ans<<endl;
    }
    else{
    cout <<NUMP/v[M-1]<<endl;
  }
    cin >>N>>M>>P;
    v.clear();
  }
  return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <string>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <algorithm>

#define FOR(i,k,n) for (int i=(k); i<(int)(n); ++i)
#define REP(i,n) FOR(i,0,n)
#define FORIT(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define sz size()
#define pb push_back
#define mp make_pair
#define ALL(X) (X).begin(),(X).end()

using namespace std;

const int INF = 1000000000;
const double eps = 1e-8;

int main(void) {
  while(1){
    int n,m,p;cin>>n>>m>>p;
    if(!n)break;
    int s=0;
    int t=0;
    REP(i,n){
      int x;cin>>x;
      s+=x;
      if(i==m-1)
        t=x;
    }
    if(t==0)
      cout<<0<<endl;
    else{
      int money=s*(100-p)/t;
      cout<<money<<endl;
    }
  }
  return 0;
}

C++: #include<iostream>

using namespace std;

int N, M, P;

int main(){
	while(cin >> N >> M >> P, N){
		int sum = 0;
		int sum_m = 0;
		for(int n=1;n<=N;n++){
			int tmp;
			cin >> tmp;
			sum += tmp;
			if(n == M) sum_m = tmp;
		}
		if(sum_m == 0)
			cout << 0 << endl;
		else
			cout << ((sum*100)-(sum*P))/sum_m << endl;
	}
	

	return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<vector>
#include<set>
#include<map>
#include<queue>
#include<string>
#include<cstring>
#define cinf(n,x) for(int i=0;i<(n);i++) cin >> x[i];
typedef long long int ll;
using namespace std;
long long GCD(long long a, long long b) { return b ? GCD(b, a%b) : a; }

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

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

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

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

int main(){
  int n,m,p;
  while(cin>>n>>m>>p,n){
    double G=0;
    int num[n];
    for(int i=0;i<n;i++){
      cin>>num[i];
      G+=100*num[i];
    }
    G*=(100.0-p)/100.0;
    if(num[m-1]!=0){
      cout << (int)G/num[m-1] << endl;
    }else{
      cout << 0 << endl;
    }
  }
  return 0;
}

C++: #include<stdio.h>
#include <iostream>
#include <math.h>
#include <numeric>
#include <vector>
#include <map>
#include <functional>
#include <stdio.h>
#include <array>
#include <algorithm>
#include <string>
#include <string.h>
#include <assert.h>
#include <stdio.h>
#include <queue>
#include<iomanip>
#include<bitset>
#include<stack>
#include<set>
#include<limits>
#include <complex>
#include<cstdlib>
using namespace std;

vector<vector<int>>outs;
int N, M, K;
bool check(const vector<int>&nums) {
	for (int i = 0; i < N-1; ++i) {
		if (outs[nums[i]][nums[i + 1]]) {
			return false;
		}
	}
	if (outs[nums[N - 1]][nums[0]]) {
		return false;
	}
	else {
		return true;
	}
}

int main() {
	while (1) {

		int N, M, P; cin >> N >> M >> P;
		if (!N)break;
		int bo;
		int si = 0;
		for (int i = 0; i < N; ++i) {
			int a; cin >> a;
			if (i == M - 1) {
				bo = a;
			}
			si += a;
		}
		if (bo) {
			int ans = ((100 - P)*si) / bo;
			cout << ans << endl;
		}
		else {
			cout << 0 << 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[M+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,h;
  int data[110];
  while(1){
    cin >> n >> m >> h;
    if(n == 0 && m == 0 && h == 0) break;
    int sum = 0;
    for(int i=0;i<n;i++){
      cin >> data[i];
      sum += data[i];
    }
    if(data[m-1]==0) {
      cout << "0" << endl;
      continue;
    }
    sum = sum * 100;
    sum = sum * (100-h);
    sum = sum / 100;
    cout << sum / data[m-1] << endl;
  }
}

C++: #include<iostream>
#include<string>
using namespace std;
int main(){
	int n,m,p,x;
	while(true){
		cin>>n>>m>>p;
		if(n==0&&m==0&&p==0)
			break;
		int w=0,a=0;
		for(int i=0;i<n;i++){
			cin>>x;
			w+=x;
			if(i==m-1)
				a+=x;
		}
		if(a==0)
			cout<<"0"<<endl;
		else
			cout<<w*(100-p)/a<<endl;
	}
	return 0;
}

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(100);

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

		vector<int>x(n);
		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(){
	for(int N, M, P; cin >> N >> M >> P, N, M, P; ){
		double bet = 0;
		vector<int> l;
		for(int i = 0; i < N; i++){
			int X; cin >> X;
			l.push_back(X);	
			bet += ((double)X * 100);
		}	
		bet *= (1 - ((double)P / 100));	
		if(l[M - 1]){cout << (int)(bet / l[M - 1]) << endl;}
		else{cout << 0 << endl;}
	}
	return 0;
}

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

#define REP(i,n) for(int i=0;i<(n);i++)
#define REAP(i,a,n) for(int i=(a);i<(n);i++)
#define YES cout<<"Yes"<<endl
#define NO cout<<"No"<<endl
#define fr first
#define sc second
#define pb push_back
#define All(v) v.begin(),v.end()
typedef long long ll;

int main(){
    ios::sync_with_stdio(false);
    int n,m,p;
    while(cin>>n>>m>>p,n){
        int x;
        double res=0,a;
        REP(i,n){
            cin >> x;
            res+=x*100;
            if(i==m-1)a=x;
        }

        res*=(100-p);
        res/=100;
        int ans=res/a;
        if(a==0)cout << 0 << endl;
        else cout << ans << endl;

    }
}