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>

using namespace std;

int main(){

  int n,m,p,sum=0,k;

  while(cin>>n>>m>>p){

    if(n==0&&m==0&&p==0){
      break;
    }

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

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

	for(int t=0;t<n;t++){

	    sum=sum+x[t];

	}

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

    
      cout<<k/x[m-1]<<endl;
      }

      sum=0;
    
    }


  return 0;
}

C++: #include<iostream>

using namespace std;

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

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

int main()
{ 
  int n, m, p;
  vector<int> ans;
  while(cin>>n>>m>>p, n||m||p)
  {
    m--;
    vector<int> x;
    for(int i=0;i<n;++i)
    {
      int t; cin>>t;
      x.push_back(t);
    }
    int sum=accumulate(x.begin(), x.end(), 0);
    int tmp;
    if(x[m]==0) tmp=0;
    else 
    {
      double t=1.0*sum/x[m];
      tmp=t*(100-p);
    }
    ans.push_back(tmp);
  }
  for(auto e: ans) cout<<e<<"\n";

  return 0;
}

C++: #include<iostream>
#include<math.h>
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 = floor((double)(sum / x[m]) - (sum / x[m]) * (p * 0.01));
		cout <<  ans << endl;

	}
	return 0;
}

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

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

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

int main(){
	int n, m, p;
	int x[100];
	while(1){
		int ans = 0;
		for(int i=0; i < 100; i++) x[i] = 0;

		cin >> n >> m >> p;

		if((n | m | p) == 0) break;

		for(int i=0; i < n; i++){
			cin >> x[i];
			ans+= x[i];
		}
		if(x[m-1] == 0){
			cout << 0 << endl;
			continue;
		}

		ans *= (100.0 - p) / x[m-1];

		cout << ans << endl;
	}

}

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

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

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

using namespace std;

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);

	int n, m, p;

	while(cin >> n >> m >> p && (n || m || p)){
		int sum = 0;
		int maisu = 0;
		int winner = -1;
		for (int i = 0;i < n;i++) {
			cin >> maisu;
			sum += maisu;
			if (i + 1 == m)winner = maisu;
		}

		if (winner!= 0) {
			cout << (sum*(100 - p)) / winner << endl;
		}
		else {
			cout << 0 << endl;
		}
		winner = -1;
		maisu = 0;
		sum = 0;


	} 

	return 0;
}

C++: #include <iostream>

using namespace std;

int main() {

  while ( true ) {
    int N, M, P;
    cin >> N >> M >> P;
    if ( N == 0 ) break;    
    
    int sum = 0, hit;
    for ( int i = 1; i <= N; i++ ) {
      int val;
      cin >> val;
      sum += val;
      if ( i == M ) {
	hit = val;
      }
    }
    const int ans = ( hit == 0 ? 0 : sum * ( 100 - P ) / hit );
    cout << ans << endl;
  }  
}

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

int main(){
  int n,m,p;
  int x;
  int sum;
  int winner;
  
  while(1){
    
    cin >> n >> m >> p;

    if(n+m+p == 0)break;
    sum=0;

    for(int i=0;i < n;i++){
      cin >> x;
      sum += x;
      if(i == m-1){
	winner = x;
      }
    }

    if(winner == 0){
      printf("0\n");
    }
    else{
      printf("%d\n",sum*(100-p)/winner);
    }
  }
  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 h = 0, hito = 0;
    
    rep(i, n){
      cin >> x[i];
      h += x[i];	
      if(i == m){
	hito = x[i];
      }
    }
    
    int ans = 0;
    rep(i, n){
      if(x[i] == 0){
	ans = 0;
	break;
      }else if(i == m){
	ans = h*(100-p)/hito;
      }
    }
    cout << ans << '\n';
  }
}

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

int main(){
	int N,M,P,sum,winner;
	
	while(cin>>N>>M>>P,N && M && P){
	    sum=0;
	    winner=0;
		for(int i=1;i<=N;i++){
			int temp;
			cin>>temp;
			if(M==i){
				winner=temp;
			}
			sum=sum+temp;
		}
		
		sum=sum*(100-P);
		
		if(winner!=0){
			sum=sum/winner;
			printf("%d\n",sum);
		}
		else{
			printf("0\n");
		}
	}
}

C++: #include<iostream>

using namespace std;

int main(){
	int N,M,P;

	while (cin>>N>>M>>P,N&&M&&P){
		int *X=new int [N];
		int goukei=0;
		for(int i=0;i<N;i++)	{
			cin>>X[i];
			goukei+=X[i];
		}

		if(X[M-1]==0){
			cout<<0<<endl;
			continue;
		}
		cout<<(goukei*(100-P))/X[M-1]<<endl;
	}
	return 0;
}

C++: #include<iostream>
#include<vector>
#include<map>
#define P pair<int,int>
using namespace std;
int main(){
int n,m;long double p;
while(cin>>n>>m>>p,n||m||p){
	int maisu=0,tmp,atari;
	long double ans=0;
	for(int i=0;i<n;i++){
		cin>>tmp;
		maisu+=tmp;
		if(i+1==m)atari=tmp;
	}
	p=1.00-(p/100);
	if(atari==0)ans=0;
	else ans=maisu*100/atari*p;
	cout<<(int)ans<<endl;
}
return 0;
}

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

int main(){
	int n, m;
	double p;
	while (1){
		cin >> n >> m >> p;
		if (n == 0 && m == 0 && p == 0) break;
		int sum = 0;
		p = p / 100;
		int winner;
		for (int i = 1; i <= n; i++){
			int c;
			cin >> c;
			if (i == m) winner = c;
			sum += c;
		}

		if (winner == 0){
			cout << 0 << endl;
			continue;
		}
		sum = (sum * 100)*(1-p);
		cout << sum / winner << endl;
	}

	return 0;
}

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

int main(){
  int n, m;
  double p;
  while(true){
    cin >> n >> m >> p;
    if(n == 0)
      break;

    double ave = 0,  deno, x;
    for(int i=0; i<n; i++){
      cin >> x;
      if(i+1 == m)
        deno = x;

      ave += x*100;
    }
    if(deno == 0)
      cout << 0 << endl;
    else{
      ave = ave * (1.0 - p/100.0) / deno;
      cout << (int)ave << endl;
    }
  }
  
  return 0;
}

C++: #include <iostream>
using namespace std;
int main(void) {
  int n, m, p;
  int x[100];
  int pool;

  while(cin >> n >> m >> p, n!=0 || m!=0 || p!=0) {
    pool = 0;
    for(int i = 1 ; i <= n ; i++) {
      cin >> x[i];
      pool += x[i];
    }
    if(x[m] == 0) cout << "0" << endl;
    else {
      int ans = pool * (100-p) / x[m];
      cout << ans << 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){

	vector<int> x(n+1);
	int total=0;
	
	for(int i=1;i<=n;++i){
	  cin>>x[i];
	  total+=x[i];
	}

	total=total*(100-p);

	
	if(x[m]==0)
	  cout<<0<<endl;
	else
	  cout<<total/x[m]<<endl;
	
  }

}