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;
    while(1){
        cin >> N >> M >> P;
        if(N==0) break;

        int total=0,win,tmp;
        for(int i=1; i<=N; i++){
            cin >> tmp;
            total+=tmp;
            if(i==M){
                win = tmp;
            }
        }
        
        if(win==0){
            cout << 0 << endl;
            continue;
        }
        cout << total*(100-P)/win << endl;
    }    
    return 0;
}

C++: #include<stdio.h>
#include<stdlib.h>
#include<iostream>
#include<math.h>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<string>
#include<cmath>
#include<set>
#include<stack>

using namespace std;
typedef unsigned long long ll;

int main(){
    int n,m,p;
    while(cin>>n>>m>>p,n){
        int x,y;
        int tot=0;
        for(int i=0;i<n;i++){
            cin>>x;
            tot+=x;
            if(i==m-1){
                y=x;
            }
        }
        cout<<(y==0?0:(tot*100*(100-p)/100)/y)<<endl;
    }
    return 0;
}

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

	}
	return 0;
}

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

int main(){
	int N,M,P,sum,winner;
	
	while(cin>>N>>M>>P,N && M && P){
	    sum=0;
	    winner=0;
		for(int i=1;i<=N;i++){
			int temp;
			cin>>temp;
			if(M==i){
				winner=temp;
			}
			sum=sum+temp;
		}
		
		sum=sum*(100-P);
		
		if(winner!=0){
			sum=sum/winner;
			printf("%d\n",sum);
		}
		else{
			printf("0\n");
		}
	}
	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;

	}
}

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

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

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

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

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

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

C++: #include <iostream>

using namespace std;

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

  while(1){
    int max=0;
    cin>>N>>M>>P;
    
    if(N==0 || 100<N || N<M || 100<P)
      break;

    int X[]={0};

    for(int i=0;i<N;i++){
      cin>>X[i];
      max+=X[i];
    }

    max=max*(100-P);

    if(X[M-1]==0)
      cout<<0<<endl;
    else
      cout<<max/X[M-1]<<endl;
  }

  return 0;
}

C++: #include<stdio.h>
int main(){
    while(1){
        int n,m,p,sum=0,d;
        scanf("%d %d %d",&n,&m,&p);
        if(n==0&&m==0&&p==0) return 0;
        for(int i=0;i<n;i++){
            int x;
            scanf("%d",&x);
            sum+=x;
            if(m==i+1) d=x;
        }
        if(d!=0) printf("%d\n",(100-p)*sum/d);
        else printf("0\n");
    }
}

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

using namespace std;

int main(void){

  int n,m,p;

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

C++: #include <cstdio>

int N, M, P, S, X[101];

int main()
{
	while (true)
	{
		S = 0; scanf("%d%d%d", &N, &M, &P);

		if (N == 0) { break; }

		for (int i = 1; i <= N; i++) { scanf("%d", &X[i]); S += X[i]; }

		printf("%d\n", X[M] == 0 ? 0 : (100 - P) * S / X[M]);
	}

	return 0;
}

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

#define rep(i, n) for (int i = 0; i < (int)n; ++i)
#define REP(i, a, b) for (int i = (int)a; i < (int)b; ++i)
#define rer(i, a, b) for (int i = (int)a; i <= (int)b; ++i)
#define each(i,c) for(__typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define all(v) v.begin(), v.end()
#define mset(a, n) memset(a, n, sizeof(a))

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<vector<int> > vvi;
typedef vector<pair<int, int> > vpii;
typedef pair<int, int> pii;
typedef pair<long long, long long> pll;

const int inf = 1000000000;
const int mod = 1000000007;
const double eps = 1e-9;
const int dx[] = { -1, 0, 1, 0};
const int dy[] = { 0, -1, 0, 1};

int main() {
	// cin.tie(0); // tie
	// ios::sync_with_stdio(false); // sync
	int N, M, P;
	while (cin >> N >> M >> P, N != 0 || M != 0 || P != 0) {
		int ticket = 0;
		int a[N];
		rep(i, N) {
			cin >> a[i];
			ticket += a[i];
		}

		if (a[M - 1] == 0) {
			cout << '0' << endl;
			continue;
		}

		int prize = 100 * ticket;
		prize -= prize * (double(P) / 100.0);

		int ans = prize / a[M - 1];
		cout << ans << endl;
	}
	return 0;
}

C++: #include<iostream>
#include<vector>
#include<string>
#include<cmath>
#include<algorithm>
#include<set>
using namespace std;
int main() {
	int n, p, m;
	while (cin >> n >> p >> m&&n != 0) {
		double sum = 100 * n, x;
		sum *= (1-(double)m/100);
		int parson = 0;
		for (int i = 0; i < n; i++) {
			cin >> x;
			if (i == p - 1) parson += x;
		}
		cout << (sum/parson) << endl;
	}
}

C++: #include <iostream>

using namespace std;

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