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;

// Debug
#define dump(x) cerr<<#x<<" = "<<(x)<<endl
#define debug(x) cerr<<#x<<" = "<<(x)<<" (L"<<__LINE__<<")"<< endl;

#define rep(i,n) for (int i=0, i##_len=(n); i<i##_len; ++i)

#define SZ(x) ((int)(x).size())

#define all(x) begin(x),end(x)


template<class T>
bool chmax(T& a, const T& b) {
    if (a < b) { a = b; return true; }
    return false;
}
template<class T>
bool chmin(T& a, const T& b) {
    if (b < a) { a = b; return true; }
    return false;
}

// std::vector debug
template<typename T>
ostream& operator<<(ostream& os, const vector<T>& v) {
    os << "[";
    for (auto& e : v) os << e << ", ";
    return os << "]";
}

// std::pair debug
template<typename T, typename U>
ostream& operator<<(ostream& os, const pair<T, U>& p) {
    return os << "(" << p.first << " " << p.second << ")";
}

// infty
template<typename T>
T inf() { return numeric_limits<T>::max(); }

using ll = long long;
using ull = unsigned long long;
using ld = long double;
using P = pair<int,int>;
using vi = vector<int>;
using vll = vector<ll>;
using vvi = vector<vector<int>>;
using vvll = vector<vector<ll>>;

const ll MOD = 1e9+7;
const ld EPS = 1e-9;


int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(10);

    for (;;) {
        int n, m, p;
        cin >> n >> m >> p;
        if (n == 0) break;
        --m;
        vi x(n);
        rep (i, n) cin >> x[i];
        if (x[m] == 0) {
            cout << 0 << endl;
            continue;
        }
        double sum = accumulate(all(x), 0);
        int ans = (sum / x[m]) * (100 - p);
        cout << ans << endl;
    }

    return 0;
}

C++: #include<iostream>

using namespace std;

int main(){
	int n,m,p;
	int ans;

	while(true){
		cin >> n >> m >> p;
		if(n == 0 && m == 0 && p == 0){
			break;
		}
		int* data = new int[n];
		int count = 0;
		for(int i=0;i<n;i++){
			cin >> data[i];
			count += data[i];
		}

		ans = 100 * count - p * count;

		if(data[m-1]==0){
			ans = 0;
		}else{
			ans /= data[m-1];
		}

		cout << ans << endl;
	}
}

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

int main(){
	long int n,m,p,i,array[100],a,price;
	long double pd,priced,tmpp;
	while(cin >> n >> m >> p && (n != 0 || m != 0 || p != 0)){
		memset(array,0,sizeof(array));
		price = 0;
		tmpp = (double)p;
		pd = (double)(1.0 - (tmpp / 100));
		for(i = 0;i < n;i++){
			cin >> a;
			array[i] = a;
			price += a * 100;
		}
		priced = (double)(price * pd);
		if(array[m-1] != 0){
			cout << (int)(priced / array[m-1]) << endl;
		}
		else {
			cout << 0 << endl;
		}
	}
	return 0;
}

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

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

int main()
{
	int n, m, p;
	int array[200];
	
	while (scanf("%d %d %d", &n, &m, &p), n + m + p){
		int sum = 0;
		for (int i = 0; i < n; i++){
			scanf("%d", &array[i]);
			sum += array[i];
		}
		
		if (array[m - 1] > 0){
			printf("%d\n", sum * (100 - p) / array[m - 1]);
		}
		else {
			puts("0");
		}
	}
	
	return 0;
}

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

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

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

int main(){
  int n,m,p;
  while(cin>>n>>m>>p){
    if(n==0)break;
    double G=0;
    int num[n];
    for(int i=0;i<n;i++){
      cin>>num[i];
      G+=100*num[i];
    }
    G*=(100-p.0)/100.0;
    cout << G << endl;
    if(num[m-1]!=0){
      cout << (int)G/num[m-1] << endl;
    }else{
      cout << 0 << endl;
    }
  }
  return 0;
}

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

int main() {
    int N, M, P;
    while (cin >> N >> M >> P && (N || M || P)) {
        vector<int> X(N);
        for (int i=0; i<N; ++i) {
            cin >> X[i];
        }
        if (X[M-1] == 0) {
            cout << 0 << endl;
        } else {
            cout << accumulate(X.begin(), X.end(), 0) * 100 * (1.0 - P / 100.0) / X[M-1] << endl;
        }
    }
    return 0;
}

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

int X[100];

int main() {
    int N, M;
	double P;
    while (cin >> N >> M >> P, N) {
        P /= 100;
        int sum = 0;
        for(int i = 0; i < N; i++){
            cin >> X[i];
            sum += 100 * X[i];
        }
        M--;
        if(X[M] == 0){
            cout << 0 << endl;
        }
        else{
            cout << int(sum / X[M] * (1 - P)) << endl;
        }
    }
}

C++: #include <iostream>
#include <string>
#include <algorithm>
#include <queue>
#include <map>
#include <set>
#include <vector>
#include <cmath>
#include <cctype>
#include <cstdlib>
#define rep(i,a,b) for(int i=(a);i<b;i++)
#define INF 1000000000
using namespace std;
bool debug=false;

int main(){
  int n,m,p;

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

    int sum=0,point;

    for(int i=1;i<=n;i++){
      int x;
      cin>>x;
      sum+=x;
      if(i==m)point=x;
    }
    double per=double((100-p))/100;
    sum=sum*100*per;
    if(debug)cout<<"sum:"<<sum<<" "<<"point:"<<point<<"   "<<"per:"<<per<<endl;
    if(point==0)cout<<0<<endl;
    else cout<<sum/point<<endl;
  }

  return 0;  
}

C++: #include <bits/stdc++.h>
using namespace std;
int main() {
	int n,m,p;
	while(cin>>n>>m>>p,n,m,p){
		int sum=0,num[101]={};
		for(int i=1;i<=n;i++){
			cin>>num[i];
			sum+=num[i];
		}
		sum*=(100-p);
		if(num[m])cout<<sum/num[m]<<endl;
		else cout<<0<<endl;
	}
}

C++: #include <bits/stdc++.h>
const int INF = 1e9;
const int MOD = 1e9+7;
using LL = long long;
const LL LINF = 1e18;
const double EPS = 1e-10;
using namespace std;
class Edge{
public:
    int from,to,value;
    Edge(LL a,LL b,LL c){
        from = a;
        to = b;
        value = c;
    }
    Edge(LL a,LL b){
        from = a;
        to = b;
    }
};

int main(){
    int n,m,p;
    while(cin >> n >> m >> p){
        if(n == 0 && m == 0 && p == 0)return 0;
        vector<int> v;
        for(int i = 0;i < n;i++){
            int b;cin >> b;
            v.push_back(b);
        }
        int sum = accumulate(v.begin(),v.end(), 0) * 100;
        sum -= sum * p / 100;
        //cout<<sum<<endl;
        if(v.at(m-1) == 0){
            cout<<0<<endl;
        }else{
            cout<<sum/v.at(m-1)<<endl;
        }
    }
}