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 <vector>

using namespace std;

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

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

using namespace std;

int main(){
	while(true){
		int n, m, p;
		cin >> n >> m >> p;
		if(n == 0 && m == 0 && p == 0){ break; }
		vector<int> x(n);
		for(int i = 0; i < n; ++i){ cin >> x[i]; }
		int sum = accumulate(x.begin(), x.end(), 0);
		int answer = 0;
		if(x[m - 1] > 0){ answer = (sum * (100 - p)) / x[m - 1]; }
		cout << answer << endl;
	}
	return 0;
}

C++: #include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <cstdio>
#define F(i,n) for(int i=0;i<(int)(n);i++)
#define INF 100000000
#define ll long long

using namespace std;
typedef pair<int, int> P;

int main() {
	int n, m, p, x[110], ans,all;
	while (1) {
		all = 0;
		cin >> n >> m >> p;
		if (n == 0 && m == 0 && p == 0) {
			break;
		}
		F(i, n) {
			cin >> x[i];
			all += x[i];
		}
		if (x[m - 1] == 0) {
			cout << 0 << endl;
			continue;
		}
		else {
			ans = all*(100-p) / x[m - 1];
			cout << ans << 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;
		int ans = (int)((sum / x[m]) - (sum / x[m]) * (p * 0.01));
		cout <<  ans << endl;

	}
	return 0;
}

C++: # include <iostream>
# include <algorithm>
# include <vector>
# include <string>
# include <set>
# include <map>
# include <cmath>
# include <iomanip>
# include <functional>
# include <utility>
# include <stack>
# include <queue>
# include <list>
using namespace std;
using LL = long long;
constexpr long long MOD = 1000000000 + 7;
constexpr long long INF = 1000000000;
const double PI = acos(-1);

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

C++: #include <iostream>
using namespace std;
#define rep(i,n) for(int i = 1 ; i <= n ; i++)

int main(){
  while(true){
    int n, m, p;
    cin >> n >> m >> p;
    if(n == 0 && m == 0 && p == 0)break;
    int x[1000];
    x[0] = 0;
    int h = 0;
    
    rep(i, n){
      cin >> x[i];
      h += x[i];
    }
    
    int ans = 0, hito = 0;
    rep(i, n){
      if(x[i] == 0){
	ans = 0;
	break;
      }else if(i == m){
	hito = x[i];
	ans = h*(100-p)/hito;
      }
    }
    cout << ans << '\n';
  }
}

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;
if(c==100)cout<<0;
else if(c==0)cout<<sum*100/b;
else cout<<(sum*100-sum*c)/b;
cout<<'\n';
}
return 0;
}