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;
using i64 = long long;
#define rep(i,s,e) for(i64 (i) = (s);(i) < (e);(i)++)
#define all(x) x.begin(),x.end()
#define let auto const

int main() {
  i64 N, M, P;
  while(cin >> N >> M >> P, N || M || M) {
    i64 sum = 0;
    i64 m = 0;
    rep(i,1,N + 1) {
      i64 a;
      cin >> a;
      sum += a;
      if(i == M) m = a;
    }
    if(m == 0) cout << 0 << endl;
    else cout << sum * 100 * (100 - P) / (m * 100) << endl;
  }
}

C++: #include <cstdio>
int main() {
	int N,M,P;
	while(scanf("%d %d %d",&N,&M,&P),N) {
		int sum=0,size=0;
		for(int i=0;i<N;i++) {
			int X;
			scanf("%d",&X);
			sum+=X;
			if(i==M-1) size=X;
		}
		sum*=100-P;
		if(size==0) {
			printf("0\n");
		}else {
			printf("%d\n",sum/size);
		}
	}
}

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

if(c==100)cout<<0;
else if(c==0)cout<<sum*100/e;
else cout<<(sum*100-sum*c)/e;
}
cout<<'\n';
}
return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <vector>
#include <stack>
#include <string>
#include <queue>
#include <cmath>
#include <numeric>
#include <list>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <climits>
#include <memory.h>
#include <memory>
#include <cstdio>
#include <cstdlib>
#include <cctype>
#include <map>
#define _USE_MATH_DEFINES
using namespace std;

typedef long long ll;
typedef pair<int, int> P;
typedef pair<int, P> PP;
typedef vector<int> vec;
typedef vector<vec> mat;
const int INF = 1 << 30;
const double EPS = 1e-9;

int nums[10000];

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

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

using namespace std;

int main(void)
{
	int n,m,p;
	int sum;
	int i1;

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

		vector<int> x(n);

		sum = 0;
		for(i1=0;i1<n;i1++){
			cin >> x[i1];
			sum += x[i1]*100;
		}

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

		if (x[m-1]==0) cout << 0 << endl;
		else cout << sum/x[m-1] << endl;

	}

	return 0;
}

C++: #include <iostream>
#include <vector>
#include <numeric>
 
using namespace std;
 
int main(){
    while(true){
        // N, M, P ?????\???
        int n, m, p;
        cin >> n >> m >> p;
 
        // 0 0 0 ????????????
        if(n == 0 && m == 0 && p == 0)
            return 0;
 
        //x ?????\???
        vector<int> x(n);
        for(auto &a:x)
            cin >> a;
 
        // ????????????????????????
        if(x[m - 1] == 0){
            cout << 0 << endl;
            continue;
        }
 
        //????テつィ??????????
        int sum = accumulate(x.begin(), x.end(), 0) * 100;
        //?????????????????????
        double total = sum * (100 - p) / 100;
        //????????????
        int money = total / x[m - 1];
 
        cout << money << endl;
    }
 
    return 0;
}

C++: #include <iostream>
#include <math.h>
using namespace std;
int main(){
	while(1){
		int n,m,p,x;
		int sum=0;
		int memo;
		cin >>n>>m>>p;
		if(n==0&&m==0&&p==0) break;
		for(int i =1;i<=n;i++){
			cin>>x;
			sum+=x;
			if(i==m) memo =x;
		}
		if(memo !=0)sum = sum*(100-p)/memo;
		else sum =0;
		cout <<sum <<endl;
	}


	return 0;
}

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

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

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

#define int long long
#define DEBUG(x) cerr <<#x<<":"<<x<<endl;
#define DEBUG2(x, y) cerr <<#x<<":"<<x<<" "<<#y<<":"<<y<<endl;
#define DEBUG3(x, y, z) cerr <<#x<<":"<<x<<" "<<#y<<":"<<y<<" "<<#z<<":"<<z<<endl;
#define DEBUGVC(x) cerr <<#x<<": "; for(auto a:x) cerr << a <<" "; cerr << endl;
#define DEBUGMP(x) cerr <<#x<<":"<<endl; for(auto a:x) cerr << a.first <<" "<< a.second << endl;
#define MAX_N (1000006)
#define INF (1LL << 60)
const int MOD = (int)1e9+7;


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

    }
}

C++: #include<cstdio>

int main(){
	int n, m;
	int p;
	while (scanf("%d %d %d", &n, &m, &p) && n | m | p){
		int sum = 0;
		int hit = 0;
		for (int i = 0; i < n; ++i){
			int	x;
			scanf("%d", &x);
			if (i + 1 == m)hit = x;
			sum += x * 100;
		}
		if (hit == 0){
			printf("%d\n", 0);
		}
		else{
			printf("%d\n", (sum*(100-p) / 100) / hit);
		}
	}
	return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <utility>
#include <numeric>

using namespace std;

int main(){
    int n,m,p;
    while(cin >> n >> m >> p, n+m+p!=0){
        vector<int> a;
        for(int i=0; i<n; i++){
            int tmp; cin >> tmp;
            a.push_back(tmp);
        }
        int sum = accumulate(a.begin(), a.end(), 0);
        int haibun = sum * (100 - p), haitou = 0;
        if(a[m-1] != 0){
            haitou = haibun / a[m-1];
        }

        cout << haitou << endl;
    }
    return 0;
}