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++: #define  _CRT_SECURE_NO_WARNINGS
#include "bits/stdc++.h"
#pragma comment (linker, "/STACK:526000000")

using namespace std;
typedef string::const_iterator State;
#define eps 1e-11L
#define MAX_MOD 1000000007LL
#define GYAKU 500000004LL

#define MOD 998244353LL
#define seg_size 262144*2LL
#define pb push_back
#define mp make_pair
typedef long long ll;
#define REP(a,b) for(long long (a) = 0;(a) < (b);++(a))
#define ALL(x) (x).begin(),(x).end()

unsigned long xor128() {
	static unsigned long x = 123456789, y = 362436069, z = 521288629, w = time(NULL);
	unsigned long t = (x ^ (x << 11));
	x = y; y = z; z = w;
	return (w = (w ^ (w >> 19)) ^ (t ^ (t >> 8)));
}

void init() {
	iostream::sync_with_stdio(false);
	cout << fixed << setprecision(10);
}

#define int ll
void solve() {
	while (true) {
		int n, m, p;
		cin >> n >> m >> p;
		if (n == 0) return;
		vector<int> inputs;
		int sum = 0;
		REP(i, n) {
			int a;
			cin >> a;
			inputs.push_back(a);
			sum += a;
		}
		m--;
		if (inputs[m] == 0) {
			cout << 0 << endl;
		}
		else {
			cout << (sum * (100 - p)) / inputs[m] << endl;
		}
	}
}
#undef int

int main() {
	init();
	solve();
}

C++: #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define all(x) (x).begin(),(x).end()
const int mod=1000000007,MAX=1<<17,INF=1<<30;

int main(){
    
    std::ifstream in("text.txt");
    std::cin.rdbuf(in.rdbuf());
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    while(1){
        int N,M,P;cin>>N>>M>>P;
        
        if(N==0&&M==0&&P==0) return 0;
        
        M--;
        int sum=0,win=0;
        
        for(int i=0;i<N;i++){
            int a;cin>>a;
            sum+=a;
            if(i==M) win=a;
        }
        
        sum*=(100-P);
        
        if(win==0) cout<<0<<endl;
        else cout<<sum/win<<endl;
    }
}

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;
	}
	if(atari==0)ans=0;
	ans=maisu/atari;
	else ans-=maisu/atari*(p/100);
	cout<<ans<<endl;
}
return 0;
}

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

using namespace std;

int main(){

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

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

int main()
{
	int n,m,p;
	while(cin>>n>>m>>p && n!=0){
		vector<int> V(n+1);
		int sum=0;
		for(int i=1;i<=n;i++){
			cin>>V[i];
			sum+=V[i];
		}
		sum*=100;

		if(V[m]==0){
			cout<<0<<endl;
		}
		else{
			sum*=(100-p);
			sum/=100;
			cout<<sum/V[m]<<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) {
    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,X[1000];
  double kazu=0,kane=0,P;
  while(1){
      cin>>N;
      cin>>M;
      cin>>P;
      if(N==0 && M==0 && P==0){
        break;
      }
      for(int lop=0;lop<N;lop++){
          cin>>X[lop];
          kazu+=X[lop];
      }
      if(X[M-1]==0){
        kane=0;
      }else{
        kane=kazu*100;
        kane*=(1.0-P*0.01);
        kane=kane/X[M-1];
      }
      cout<<(int)kane<<endl;
      kane=0;
      kazu=0;
      for(int lop=0;lop<N;lop++){
          X[lop]=0;
      }
  }

  return 0;
}

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

int main(void){
	int N, M, P;
	while(scanf("%d %d %d", &N, &M, &P) != EOF && (N != 0 && M != 0 && P != 0)){
		int sum = 0;
		int *X = new int[N];
		for(int i = 0; i < N; i++){
			scanf("%d", X+i);
			sum += X[i];
		}
		if(X[M-1] == 0){
			printf("%s\n", "0");
		}else{
			printf("%d\n", (int)((sum * (100 - P)) / X[M-1]));
		}
        delete[] X;
	}
  return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
#define reps(i,j,k) for(int i=j;i<k;++i)
#define rep(i,j) reps(i,0,j)
int main(){
	int n, m, s;
	while (true){
		cin >> n >> m >> s;
		if (n + m + s == 0)break;
		int p;
		int sum = 0;
		int g = -1;
		rep(i, n){
			scanf("%d", &p);
			if (i == m - 1){
				g = p;
			}
			sum += p;
		}
		double res = (double)sum * ((100-s) / 100.0) / g;
		if (g == 0){
			puts("0");
		}
		else printf("%.lf\n", floor(res * 100));
	}
	return 0;
}

C++: #include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<map>
#include<cstring>
#include<cstdio>
using namespace std;

#define rep(i,n) for(int i=0;i<n;i++)
#define REP(n) rep(i,n)
#define all(n) n.begin(),n.end()

const int MAXN = 101;

int x[MAXN];

int main()
{
    int n , m, p;
    while(cin >> n >> m >> p && p)
    {
        int sum = 0;
        m--;
        REP(n) { cin >> x[i]; sum += x[i] ;}

        int ans = 0;
        
        if(x[m] != 0) ans = (100 - p) * sum / x[m];
        cout << ans << endl;
    }

    return 0;
}

C++: #include <iostream>
#include <vector>
#include <string>
#include <sstream>
#include <algorithm>
#include <map>
#include <set>
#include <cstdio>
#include <cmath>
#define rep(i,l,n) for(lint i=l;i<n;i++)
#define rer(i,l,n) for(lint i=l;i<=n;i++)
#define all(a) a.begin(),a.end()
#define o(a) cout<<a<<endl
#define pb(a) push_back(a)
#define mk(a,b) make_pair(a,b)
#define fi first
#define se second
using namespace std;
typedef long long lint;
typedef vector<int> vi;
typedef vector<lint> vli;
typedef vector<vi> vvi;
typedef pair<int,int> pii;

int main(){
	int n,m,p;
	while(1){
		cin>>n>>m>>p;
		if(n+m+p==0) break;
		int sum=0,win;
		rep(i,1,n+1){
			int a;
			cin>>a;
			sum+=a;
			if(i==m) win=a;
		}
		o((win==0?0:(100-p)*sum/win));
	}
}

C++: #include<iostream>

using namespace std;

int main(){
  int N,M,X[1000];
  double kazu=0,kane=0,P;
  while(1){
      cin>>N;
      cin>>M;
      cin>>P;
      if(N==0 && M==0 && P==0){
        break;
      }
      for(int lop=0;lop<N;lop++){
          cin>>X[lop];
          kazu+=X[lop];
      }
      if(X[M-1]==0){
        cout<<0<<endl;
      }else{
        kane=kazu*100;
        kane*=(1.0-P*0.01);
        kane=kane/X[M-1];

        cout<<(int)kane<<endl;
      }
      kane=0;
      kazu=0;
      for(int lop=0;lop<N;lop++){
          X[lop]=0;
      }
  }

  return 0;
}