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 N,M,P;
int X[111];
int main(){
  while( cin >> N >> M >> P && (N||M||P) ){
    int sum = 0;
    for(int i=0;i<N;i++) {
      cin >> X[i];
      sum += X[i];
    }
    sum*=100;
    sum*=(100-P);
    if( X[M-1] == 0 ) cout << 0 << endl;
    else {
      sum/=X[M-1];
      sum/=100;
      cout << sum << endl;
    }
  }
}

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

#define rep(i,n) for(int i=0;i<n;i++)

int main()
{
	int n, m, p;
	while (cin >> n >> m >> p && n || m || p)
	{
		double tmp, votnum, summoney = 0, votsum = 0;
		for (int i = 1; i <= n; i++)
		{
			cin >> tmp;
			//????????¶???????????????
			if (i == m)
			{
				//????\¨??????0??????
				if (!tmp)
				{
					goto escp;
				}
				votnum = tmp;
			}
			votsum += tmp;
		}
		votsum = votsum * 100 * (p / 100.0);
		cout << votsum / votnum << endl;
	escp:
	}
	return 0;
}

C++: #include<iostream>

using namespace std;

#define REP(i,n) for(int i = 0;i < n;i++)
	
int main()
{
	int n,m,p;
	while(cin >> n >> m >> p,n)
	{
		int kyo[n],sum = 0;
		REP(i,n)
		{
			cin >> kyo[i];
			sum += kyo[i];
		}
		if(kyo[m-1] == 0)
		{
			cout << 0 << endl;
			continue;
		}
		
		int ans = (100 - p) * sum / kyo[m-1];
		cout << ans << endl;
		
	}
	
	return 0;
}

C++: #include <iostream>
using namespace std;
int main(){
  int n,m,p;
  int num[100];
  while(cin >> n >> m >> p && n&&m&&p){
    int sum = 0;
    for(int i=0; i<n; i++){
      cin >> num[i];
      sum+=num[i];
    }
    sum *= (100-p);
    if(!num[m-1])
      cout << num[m-1] << endl;

    else
      cout << sum/num[m-1] << endl;
  }
}

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

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

		vector<int>x(n,0);
		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>
using namespace std;

int main(){
        int i,m,n,p,sum_gold,a_get;
        a_get=0;
        int a[100];
        for(i=0; i<100; i++) {
                a[i]=0;
        }

        while(1) {
                sum_gold=0;
                cin >> m >> n >> p;

                if((m==0)&&(n==0)&&(p==0)) {
                        break;
                }

                for(i=0; i<m; i++) {
                        cin >> a[i];
                        sum_gold+=a[i];
                }

                if(a[n-1]==0) {
                        cout << 0 << endl;
                }else{
                        sum_gold=sum_gold*100;

                        sum_gold=sum_gold*(100-p)/100;

                        a_get=sum_gold/a[n-1];

                        cout << a_get <<endl;
                }
        }
}

C++: #include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <string>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>

#define rep(i, j) FOR(i, 0, j)
#define FOR(i, j, k) for(int i = j; i < k; ++i)

using namespace std;

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

    if(x[m] != 0) printf("%d\n", sum /= x[m-1]);
    else puts("0");
  }
  return 0;
}

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

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

using namespace std;


bool solve(){
	
	int n, m, p;
	cin>> n>> m>> p;
	if(n==0 && m==0 && p==0) return false;
	
	int a=0, b=0;
	for(int i=0;i<n;i++){
		int in;
		cin>> in;
		a += in;
		if(i == m-1) b = in;
	}
	if(b==0){	//気付かぬ…
		cout<< 0<< endl;
	}else{
		cout<< a*100 * (100-p)/100 / b<< endl;
	}
	return true;
}

int main(){
	cout.setf(ios::fixed);
	cout.precision(10);
	while(solve());

	return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
	int a,b,c,i,d,sum;
	while(1){
		sum=0;
	cin>>a>>b>>c;
	if(a==0&&a==b&&c==0)break;
for(i=0;i<a;i++){
cin>>d;
sum+=d;
if(i==b-1)b=d;
}
if(b==0)cout<<b<<endl;
if(c==100)cout<<0<<endlel;
else if(c==0)cout<<sum*100/b<<endl;
else cout<<(sum*100-sum*c)/b<<endl;
}
return 0;
}

C++: #include<iostream>
#include<vector>
#include<map>
#define P pair<int,int>
using namespace std;
int main(){
int n,m,p;
while(cin>>n>>m>>p,n||m||p){
	int maisu=0,tmp,atari;
	int  ans=0;
	for(int i=0;i<n;i++){
		cin>>tmp;
		maisu+=tmp*100;
		if(i+1==m)atari=tmp;
	}
		//cout<<"p"<<p;
	if(atari==0)ans=0;

	else {
		ans=maisu*100;
		ans-=maisu*p;
		ans=ans/atari;
	}
	cout<<ans/100<<endl;
}
return 0;
}

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

int main(void){
    int t;
    int n,m,p;
    int ans;
    vector<int>x;
    while(true) {
        cin >> n>>m>>p;
        if(n==0)break;
        x=vector<int>(0);
        ans=0;
        for(int i=0;i<n;i++){
            cin>>t;
            x.push_back(t);
            ans+=t;
        }
        ans=ans*(100-p);
        if(x[m-1]!=0)ans=ans/x[m-1];
        else ans=0;
        cout<<ans<<endl;
    }
    return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
	int a,b,c,i,d,sum;
	while(1){
		sum=0;
	cin>>a>>b>>c;
	if(a==0&&a==b&&c==0)break;
for(i=0;i<a;i++){
cin>>d;
sum+=d;
if(i==b-1)b=d;
}
if(b==0)cout<<b<<endl;
if(c==100)cout<<0<<endl;
else if(c==0)cout<<sum*100/b<<endl;
else cout<<(sum*100-sum*c)/b<<endl;
}
return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
	int a,b,c,i,d,sum;
	while(1){
		sum=0;
	cin>>a>>b>>c;
	if(a==0&&a==b&&c==0)break;
for(i=0;i<a;i++){
cin>>d;
sum+=d;
if(i==b-1)b=d;
}
if(b==0)cout<<b<<endl;
else cout<<(sum*100-sum*c)/b<<endl;
}
return 0;
}

C++: #include<iostream>
using namespace std;
 
int main(){
  while(1){
  int N,M,P;
  int sum=0;
  cin>>N>>M>>P;
  if(N+M+P==0) break;
  int X[1001];
  for(int i=1;i<=N;i++){
    cin>>X[i];
    sum+=X[i];
  }
  sum*=100;
  sum=sum-(sum*P)/100;
  if(X[M]==0) sum=0;
  else sum/=X[M];
  cout<<sum <<endl;
  }
   
  return 0;
  }

C++: #include <bits/stdc++.h>
using namespace std;
using uint = unsigned int;
using lint = long long int;
using ulint = unsigned long long int;
template<class T = int> using V = vector<T>;
template<class T = int> using VV = V< V<T> >;
template<class T, class U> void assign(V<T>& v, int n, const U& a) { v.assign(n, a); }
template<class T, class... Args> void assign(V<T>& v, int n, const Args&... args) { v.resize(n); for (auto&& e : v) assign(e, args...); }


int main() {
  cin.tie(nullptr); ios_base::sync_with_stdio(false);
  while (true) {
    int n, m, p; cin >> n >> m >> p, --m;
    if (n == 0) break;
    V<> x(n); for (int i = 0; i < n; ++i) cin >> x[i];
    int sum = accumulate(begin(x), end(x), 0) * (100 - p);
    int res = x[m] ? sum / x[m] : 0;
    cout << res << '\n';
  }
}