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<cmath>
#include<iostream>
#include<algorithm>
#include<iomanip>
#include<vector>
#include<string>
#include<queue>
#include<stack>
#include<cstdio>
#include<map>
#define rep(i,n) for(int i=0;i<n;i++)
#define fori(i,k,n) for(int i=k;i<n;i++)
using namespace std;
const int dx[4] = { 0, 1, 0, -1 }, dy[4] = { 1, 0, -1, 0 };
const int dX[8] = { 0, 1, 1, 1, 0, -1, -1, -1 }, dY[8] = { 1, 1, 0, -1, -1, -1, 0, 1 };
/*
(char)'1' - (int)48 = (int)1; 


*/


int main()
{

	int n, m, p;
	cin >> n >> m >> p;
	while (n != 0|| m != 0 || p != 0)
	{
		int a[110];
		double al = 0;
		for (int i = 0; i < n; i++)
		{
			cin >> a[i];
			al += a[i]*100;
		}
		al = al*(100-p)/100;
		if (a[m - 1] == 0)
		{
			cout << 0 << endl;
		}
		else
		{
			al /= a[m - 1];
			int ans = al;
			cout << ans << endl;
		}



		cin >> n >> m >> p;
	}
}

C++: #include<iostream>

using namespace std;

int main(){
  while(1){
    int N,M,P;
    cin >> N >> M >> P;
    if(N==0&&M==0&&P==0)break;
    int sum=0;
    int mem;
    for(int i=1;i<=N;i++){
      int input;
      cin >> input;
      sum+=input;
      if(i==M)mem=input;
    }
    sum=sum*(100-P);
    cout << (mem?sum/mem:0) << endl;
  }
}

C++: #include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
#define bye return 0

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

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

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

    return 0;
}

C++: #include <stdio.h>
#include <limits.h>
#include <math.h>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <cstring>
#include <string>
#include <sstream>
#include <algorithm>
#include <iomanip>
#include <iostream>

#define VARIABLE(x) cerr << #x << "=" << x << endl
#define BINARY(x) static_cast<bitset<16> >(x);
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define REP(i,m,n) for (int i=m;i<(int)(n);i++)
#define if_range(x, y, w, h) if (0<=(int)(x) && (int)(x)<(int)(w) && 0<=(int)(y) && (int)(y)<(int)(h))

const int INF = 100000000;
typedef double D;
const double EPS = 1e-8;
const double PI = 3.14159;
int dx[4]={-1, 0, 1, 0}, dy[4]={0, -1, 0, 1};
using namespace std;
typedef pair<int, int> P;

/** Problem2018 : Princess's Gamble **/
int main()
{
	int N, M, P;
	while (cin>>N>>M>>P, N||M||P) {
		vector<int> list(N);
		double sum=0;
		rep(i, N) {
			cin >> list[i];
			sum += list[i]*100;
		}
		sum -= sum*P/100;
		
		if (list[M-1] == 0)
			cout << 0 << endl;
		else
			cout << floor(sum/list[M-1]) << endl;
	}
}

C++: // ???????????????????¬¢?§?????????£????????? 
// http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=2018
// ????????????????¨?????????????20????????????????????????????????? 20???????????????????????´??????15?????????
//C++??§??????35??? = 90???

#include <iostream>
using namespace std;

#define NUM 100

int main(){
  int N,M,P; //??????????????¨??????
  double gold = 0; //?¨????????????¨
  double give; //?¨????????????¨
  double pull; //?¨????????????¨
  double get[NUM]; //????????£?????????????????????
  int num[NUM]; //?¨????????????¨
  int count = 0;
  int i;


  while(1){
    count++;
    cin >> N >> M >> P;
    
    if ((N==0 && M==0 && P==0) || count > 100){ //?????????????????????100??\??????0 0 0
      count--; //??¨????????°?????????????????§???????????????????????°??????
      break;
    }

    for (i=0; i < N ;i++){ ////?????????????????´??????????????¨???????¨????
      cin >> num[i];
      gold += num[i] * 100;;
    }
    
    // ?¨??????????????????§???
    give = gold / num[M-1]; //M-1??¨????????????i?????????????§??????£???????????????
    pull = give * P /100;
    get[count - 1] = give - pull; //count-1??¨????????????count???0????????§??????
    gold = 0; //?????????             //??????????§?????????????
    //???????????§
    
    if (num[M-1] == 0){ //????????????????????¨??????????????????0?????¨?????????????????????????????°????????????
      get[count - 1] = 0;
    }
    
    for (i=0; i < N ;i++){ //?????????
      num[i] = 0;
    }
  }

  for (i=0; i < count ;i++){ //output
    cout << (int)get[i] << "\n";
  }
  return 0;
}

C++: #include <iostream>
#include <vector>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <algorithm>

using namespace std;
using vi = vector<int>;
using vvi = vector<vi>;
template<class T> using hset = unordered_set<T>;
template<class Key, class T> using hmap = unordered_map<Key, T>;

int dx[] = {0, 1, 0, -1};
int dy[] = {1, 0, -1, 0};

int main() {
    int n, m, p, sum, win, tmp;
    while (cin >> n >> m >> p) {
        if (n == 0) break;
        sum = 0;
        for (int i = 1; i <= n; i++) {
            cin >> tmp;
            sum += tmp;
            if (i == m) win = tmp;
        }

        if (win == 0) cout << 0 << endl;
        else cout << (100*sum)*(100-p)/(win*100) << endl;
    }

    return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
  while(1){
    int n,m,p;
    cin>>n>>m>>p;
    if(n==0){
      break;
    }
    m--;
    vector<int> x(n);
    int sum=0;
    for(int i=0;i<n;i++){
      cin>>x[i];
      sum+=x[i];
    }
    sum*=100;
    double temp=(double)sum;
    temp-=temp*((double)p/100.0);
    if(x[m]==0){
      cout<<0<<endl;
      continue;
    }
    cout<<(int)temp/x[m]<<endl;
  }
  return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <stdlib.h>
#include <string>
#include <queue>
using namespace std;

int main(){
int n,m,p;
while(cin>>n>>m>>p && n!=0){
int a[104]={0};
int sum=0;
for(int i=1;i<n+1;i++){
cin>>a[i];
sum=sum+a[i];
}
int ans=sum*p;
if(a[m]==0) ans=0;
else ans=ans/a[m];
cout<<ans<<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)/100.0;
		
		for(i=0; i<N; ++i){
			cin >> X;
			sum+=100*X;
			v.push_back(X);
		}
		sum*=rate;
		
		if(v[M-1]==0) cout << 0 << endl;
		else cout << (int)(sum/v[M-1]) << endl;
		
		cin >> N >> M >> P;
	}
	return 0;
}

C++: #include<iostream>
using namespace std;
int main() {
	int n, m;double p;
	while (cin >> n >> m >> p) {
		p /= 100;
		int x[100] = {}, cnt = 0;
		for (int i = 0; i < n; i++) {
			cin >> x[i];
			if (x[i] == m)cnt++;
		}
		double money = 100 * n;
		money = money*(1.0 - p);
		if (!cnt)cout << 0 << endl;
		else cout << money / cnt << endl;
	}
	return 0;
}