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>
#include<cstring>
#include<algorithm>
#include<string>
#include<vector>
#include<cstdio>
#include<cmath>
#define pb(in,tmp) in.push_back(tmp)
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,b) loop(i,0,b)
#define all(in) in.begin(),in.end()
const double PI=acos(-1);
using namespace std;
int main(){
  int n,m,p;
  while(cin>>n>>m>>p,n||m||p){
    int ans=0;
	vector<int>in(n);
	rep(i,n){cin>>in[i];ans+=in[i]*100;}
	if(!in[m-1])cout<<0<<endl;
	else{
	  ans*=(100-p)/100.0;
	  	cout<<ans<<endl;
	  ans/=in[m-1];
	  cout<<ans<<endl;
    }
  }
}

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

#define rep(i, n) for(int i = 0; i < n; i ++)
#define ALL(T) T.begin(), T.end()
#define mp make_pair
#define pb push_back
#define ITER(c) __typeof((c).begin())
#define each(c, it) for(ITER(c) it = (c).begin(); it != (c).end(); it++)
#define X first
#define Y second

using namespace std;

typedef pair<int, int> pii;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<string> vs;

const int INF = 1 << 24;

int main(void){
    for(int n, m, p; cin >> n >> m >> p, n;){
        int cnt = 0, ind = 0, nm;
        while(n--){
            int x; cin >> x;
            if(m == ++ind) nm = x;
            cnt += x;
        }
        cout << (nm ? 100 * cnt * (100 - p) / nm / 100:0) << endl;
    }

    return 0;
}

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

using namespace std;

int main(void){

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

    int a,b = 0;
    int total = 0;

    for( int i = 1 ; i <= n ; i++ ){
      cin >> a; 
      if(i == m) b = a;
      total += a;
    }
    if(b){
      total = total * 100 * (100 - p)/ (b * 100);
      cout << total << endl;
    }else cout << "0" << endl;
  }
  return 0;
}

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



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

C++: #include "bits/stdc++.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) {
                if (n == 0 && m == 0 && p == 0) break;
                vector<int> x(n);
                double sum = 0;
                rep(i, n) { 
                        cin >> x[i];
                        sum += x[i];
                }
                sum *= 100;
                double s = sum * (double)p / 100.0;
                sum -= s;
                if (x[m - 1] == 0) cout << 0 << endl;
                else cout << (int)(sum / x[m - 1]) << endl;
        }
        return 0;
}

C++: #include <iostream>

using namespace std;

int main() {
    int N, M, P, X[101];
    while (cin >> N >> M >> P) {
        if (N == 0 && M == 0 & P == 0) { break; }

        int ans = 0;

        for (int i = 0; i < N; i++) {
            cin >> X[i];
            ans += X[i];
        }
        cout << (X[M-1] == 0 ? 0 : ans * (100-P) / X[M-1]) << endl;
    }
    return 0;
}

C++: #include <iostream>
#include <string>
#include <vector>
#include <math.h>
#include <numeric>
#include <algorithm>
using namespace std;
int N, M, P;

int main() {
    while(cin >> N >> M >> P, N&&M&&P){
        vector<int> v;
        int sum=0;
        for(int i=0; i<N; ++i){
            int a; cin >> a; v.push_back(a);
            sum += a;
        }
        if(v[M-1]!=0){  
            cout << sum*(100-P)/v[M-1] << endl;
        }else{
            cout << 0 << endl;
        }
    }    
    
    return 0;
}

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

int n, m, p;

int main(){
//	cin.tie(0);
//	ios::sync_with_stdio(false);
	while(1){
		cin >> n >> m >> p;
		if(n == 0 && m == 0 && p == 0) return 0;
		int s = 0, t = 0;
		for(int i=0; i<n; ++i){
			int tmp;
			cin >> tmp;
			s += tmp;
			if(i == m-1) t = tmp;
		}
//		cout << s << " " << t << "\n";
		s *= 100;
		s = s * (100 - p) / 100;
		if(t == 0) cout << 0 << "\n";
		else{
			s /= t;
			cout << s << "\n";
		}
	}
}

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

int main()
{
	while (true) {
		int N, M, P;
		cin >> N >> M >> P;

		if (N == 0 && M == 0 && P == 0) {
			break;
		}

		int top;
		int sum = 0;

		for (int i = 1; i <= N; i++) {
			int temp;
			cin >> temp;

			sum += temp;

			if (M == i) {
				top = temp;
			}
		}

		int ans;

		if (top != 0) {
			ans = sum*(100 - P) / top;
		}
		else {
			ans = 0;
		}

		cout << ans << endl;
	}

	return 0;
}

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

#define TN_MAX 101

using namespace std;

int main () {
  while( 1 ) {
    int n, m, p;
    int sum = 0;
    int tn[ TN_MAX ];
    cin >> n >> m >> p;
    if ( !n && !m && !p ) {
      return EXIT_SUCCESS;
    }
    for( int i = 1; i <= n; i++ ) {
      cin >> tn[ i ];
      sum += tn[ i ];
    }
    if( tn[ m ] == 0 ){
      cout << 0 << endl;
    }else{
      int o = sum * ( 100 - p ) / tn[ m ];
      cout << o << 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 x[n];
		for(int i=0;i<n;i++){
			cin>>x[i];
		}
		if(x[m-1]==0){
			cout<<0<<endl;
			break;
		}
		int t=0;
		for(int i=0;i<n;i++){
			t=t+x[i];
		}
		cout<<(t*(100-p))/x[m-1]<<endl;
	}
    return 0;
}