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> // C++の入出力
#include <stdio.h> // C の入出力
#include <algorithm> // sort などのアルゴリズム
#include <string.h> // C の文字列用
#include <ctype.h> // C の文字種用
#include <string> // C++の文字列
using namespace std;
int main(void){
    while(1){
        int nin,yu,pars;
        cin>>nin>>yu>>pars;
        if(nin==0&&yu==0&&pars==0)break;
        int data[nin],cnt=0,kin=0;
        for(int i=1;i<=nin;i++){
            cin>>data[i];
            if(i==yu)cnt++;
            kin+=data[i]*100;
        }
        double ritu=1-((double)pars/(double)100);
        int bunpai=kin*ritu;
        if(data[yu]==0)cout<<"0"<<endl;
        else cout<<bunpai/data[yu]<<endl;
    }
    return 0;
}

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

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

C++: #include<stdio.h>

int main(){

int N,M,P;
while(1){

scanf("%d %d %d",&N,&M,&P);
if(N==0&&M==0&&P==0)break;

int x,s=0,y=0;
for(int i=0;i<N;i++){
scanf("%d",&x);s+=x;
if(M==i+1)y=x;

}
if(y!=0){
int t=100*s;
t=t/y*(100-P)/100;
printf("%d\n",t);
}
else printf("0\n");
}
return 0;
}

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

using namespace std;

void solve()
{
	int N, M, P;
	while(cin >> N >> M >> P, N || M || P)
	{
		vector<int> Vec(N);
		int sum = 0;
		for(int i = 0; i < N; ++i)
		{
			cin >> Vec[i];
			sum += Vec[i];
		}
		if(Vec[M - 1] == 0)
		{
			cout << 0 << endl;
			continue;
		}
		sum *= (100 - P);
		cout << sum / Vec[M - 1] << endl;
	}
}

int main()
{
	solve();
	return(0);
}

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 gol = 0;
    int h = 0;
    double kekka = 0.0;
    
    rep(i, n){
      cin >> x[i];
      h += x[i];
      gol += 100 * x[i];
    }
    kekka = gol*(100-p)/100;
    int ans = 0;
    rep(i, n){
      if(x[i] == 0){
	ans = 0;
	break;
      }else if(i == m){
	ans = (int)kekka/x[i];
      }
    }
    cout << ans << '\n';
  }
}

C++: #include <bits/stdc++.h>
using namespace std;
#define int long long
#define Rep(i, N) for(int i = 0; i < N; i++)
#define Reps(i, x, N) for(int i = x; i < N; i++)

const int LLINF = 1LL << 60;

signed main()
{
  int N, M, P;
  while(cin >> N >> M >> P, N || M || P) {
    
    int A[105];
    P = 100 - P;

    Rep(i, N) cin >> A[i];
    --M;
    if(A[M]) cout << accumulate(A, A + N, 0LL) * 100 * P / A[M] / 100 << endl;
    else cout << 0 << endl;
  }

  return 0;
}

C++: #include <algorithm>
#include <bitset>
#include <cassert>
#include <climits>
#include <cmath>
#include <complex>
#include <cstring>
#include <ctime>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <tuple>
#include <vector>
using namespace std;
typedef long long ll;
#define _ << " " <<
#define all(X) (X).begin(), (X).end()
#define Pii pair<int, int>
#define Pll pair<ll, ll>
#define Ti4 tuple<int, int, int, int>
#define Tlll tuple<ll, ll, ll>
#define PI 3.141592653589793

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

C++: #include <bits/stdc++.h>
using namespace std;
#define reps(i,j,k) for(int i=j;i<k;++i)
#define rep(i,j) reps(i,0,j)
int main(){
	int n, m, s;
	while (true){
		cin >> n >> m >> s;
		if (n + m + s == 0)break;
		int p;
		int sum = 0;
		int g = -1;
		rep(i, n){
			scanf("%d", &p);
			if (i == m - 1){
				g = p;
			}
			sum += p;
		}
		int res = sum * 100;
		res = res * ((100-s) / 100.0) / g;
		if (g == 0){
			puts("0");
		}
		else printf("%d\n", res);
	}
	return 0;
}

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

int Sum(const int* X, int size) {
  int sum = 0;
  for(int i = 0; i < size; i++) {
    sum += X[i];
  }
  return sum;
}

int Devide(int d, const int *X, int M) {
  if(X[M] != 0) 
    return (int)(d / X[M]);
  else
    return 0;
}

int main() {
  int N; //競技者の数
  int M; //優勝者の番号
  int P; //控除率(百分率)
  vector<int> X;
  int deduction;

  while(1) {
    cin >> N >> M >> P;
    if(N == 0 && M == 0 && P == 0)
        break;
      
    for(int i = 0; i < N; i++) {
      int x;
      cin >> x;
      X.push_back(x);
    }
    
    deduction = Sum(&X.front(), X.size()) * (100-P);
    cout << Devide(deduction, &X.front(), M-1) << endl;
    X.clear();
  }

}

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

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

C++: #include<iostream>

using namespace std;

int main(){
  int N,M,X[1000],kazu=0,kane=0,P;
  while(1){
      cin>>N;
      cin>>M;
      cin>>P;
      if(N==0 && M==0 && P==0){
        break;
      }
      for(int lop=0;lop<N;lop++){
          cin>>X[lop];
          kazu+=X[lop];
      }
      if(X[M-1]==0){
        kane=0;
      }else{
        kane=kazu*100;
        kane*=1.0-(double)P*0.01;
        kane=(double)kane/(double)X[M-1];
      }
      cout<<kane<<endl;
      kane=0;
      kazu=0;
      for(int lop=0;lop<N;lop++){
          X[lop]=0;
      }
  }

  return 0;
}

C++: #include <iostream>
#include <complex>
#include <sstream>
#include <string>
#include <algorithm>
#include <deque>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <vector>
#include <set>
#include <limits>
#include <cstdio>
#include <cctype>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <ctime>
using namespace std;
#define REP(i, j) for(int i = 0; i < (int)(j); ++i)
#define FOR(i, j, k) for(int i = (int)(j); i < (int)(k); ++i)
#define SORT(v) sort((v).begin(), (v).end())
#define REVERSE(v) reverse((v).begin(), (v).end())
typedef complex<double> P;

int main() {
  int N, M, P;
  bool f = false;
  while(cin >>N >>M >>P && N){
    if(f) cout <<endl;
    f = true;
    int sum = 0, h = 0;
    REP(i, N){
      int tmp; cin >>tmp;
      sum += (tmp * 100);
      if(i + 1 == M) h = tmp;
    }
    sum = (int)(sum * (1.0 - P / 100.0));
    cout <<(h == 0 ? 0 : sum / h);
  }
  return 0;
}

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

int n, m, p;
int x[102];

int main(){
  while(cin >> n >> m >> p, n || m || p){
    double sum = 0;

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

    sum *= (100 - p) / 100.0;

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

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
  int N, M, P;
  int A[100];
  int s;
  cin >> N >> M >> P;
  while( N!=0 || M!= 0 || P!= 0){
  	s = 0;
  	for(int i = 0; i < N; i++){
  		cin >> A[i];
  		s += A[i];
  	}
  	if(A[M-1] != 0)cout << s*(100-P)/A[M-1] << endl;
  	else cout << 0 << endl;
  	cin >> N >> M >> P;
  }
  return 0;
}