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>
#include<map>
#define P pair<int,int>
using namespace std;
int main(){
int n,m,p;
while(cin>>n>>m>>p,n||m||p){
	int maisu=0,tmp,atari;
	double  ans=0;
	for(int i=0;i<n;i++){
		cin>>tmp;
		maisu+=tmp*100;
		if(i+1==m)atari=tmp;
	}
		//cout<<"p"<<p;
	if(atari==0)ans=0;

	else {
		ans=maisu/atari;
		double koujo=(ans*p/100);
	ans=ans-koujo;
	}
	cout<<(int)ans<<endl;
}
return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
    while(1){
        int N,M,P,save,sum=0,x;
        cin >> N >> M >> P;
        if(N==0&&M==0&&P==0)    break;
        for(int i=0;i<N;i++){
               cin >> x;
               if((M-1)==i) save = x;
               sum += x;
        }
        if(save!=0)
            cout << sum*(100-P)/save << endl;
        else
            cout << 0 << endl;
    }
}

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

int main(){
     int N,M,P;
     while(cin>>N>>M>>P,N||M||P){
	  int win=0,sum=0;
	  for(int i=0;i<N;i++){
	       int num;
	       cin>>num;
	       if(i==M-1) win=num;
	       sum+=num;
	  }
	  if(win==0){
	       cout<<0<<endl;
	  }else{
	       cout<<sum*(100-P)/win<<endl;
	       //cout<<sum<<" "<<P<<" "<<win<<endl;
	  }
     }
}

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

int main(){

    while(1){
        int N, M, P;
        cin>> N>> M>> P;
        if(!(N||M||P)) break;
        int X[N];
        for(int i=0; i<N; i++) cin>> X[i];

        int s=100*accumulate(X, X+N, 0);
        int haito=s/100*(100-P);

        cout<< (X[M-1]==0? 0: haito/X[M-1])<< endl;
    }
    
    return 0;
}

C++: #include<iostream>
#include<string.h>
#include<string>
#include<cstdio>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<cmath>
#include<utility>
#include<set>
#define ll long long int
#define ld long double
#define INF 1000000000
#define EPS 0.0000000001
#define rep(i,n) for(i=0;i<n;i++)
using namespace std;
typedef pair<int, int> pii;

int main()
{
  int n,m,p,x;
  int num[105]={};
  int i;

  while(1){
    cin>>n>>m>>p;
    if(n==0 && m==0 && p==0)break;
    ll sum=0LL;
    rep(i,n){
      cin>>x;
      num[x]++;
      sum+=x;
    }
    sum=sum*(100-p);
    if(num[m])
      cout<<sum/num[m]<<endl;
    else 
      cout<<"0"<<endl;
  }

}

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

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

int main() {
	while (cin >> n >> m >> p) {
		if (!n) break;
		for (int i = 0; i < n; i++) cin >> x[i];
		m--;
		
		int sumX = 0;
		for (int i = 0; i < n; i++) sumX += x[i];
		
		if (x[m] == 0) {
			cout << 0 << endl;
		}
		else {
			cout << sumX * (100 - p) * 100 / (100 * x[m]) << 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];
		}
		if(num[m])cout<<max((int)((sum*(100-p))/num[m]),100)<<endl;
		else cout<<0<<endl;
	}
}

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

using namespace std;

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

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

#define pb(n) push_back(n)
#define fi first
#define se second
#define all(r) (r).begin(),(r).end()
#define gsort(st,en) sort((st),(en),greater<int>())
#define vmax(ary) *max_element(all(ary))
#define vmin(ary) *min_element(all(ary))
#define debug(x) cout<<#x<<": "<<x<<endl
#define fcout(n) cout<<fixed<<setprecision((n))
#define scout(n) cout<<setw(n)
#define vary(type,name,size,init) vector< type> name(size,init)
#define vvl(v,w,h,init) vector<vector<ll>> v(w,vector<ll>(h,init));

#define rep(i,n) for(int i = 0; i < (int)(n);++i)
#define REP(i,a,b) for(int i = (a);i < (int)(b);++i)
#define repi(it,array) for(auto it = array.begin(),end = array.end(); it != end;++it)
#define repa(n,array) for(auto &n :(array))

using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using dict = map<string,int>;
using pii = pair<int,int> ;
using pll = pair<ll,ll> ;

const int mod = 1000000007;
constexpr int imax = ((1<<30)-1)*2+1 ;
constexpr int inf = 100000000;
constexpr double PI = acos(-1.0) ;
double eps = 1e-10 ;
const int dy[] = {-1,0,1,0,1,-1,1,-1};
const int dx[] = {0,-1,0,1,1,-1,-1,1};

inline bool value(int x,int y,int w,int h){
  return (x >= 0 && x < w && y >= 0 && y < h);
}

template<typename T>
void Unique(vector<T> &v){
  sort(all(v));
  v.erase(unique(all(v)),v.end());
}

template<typename T>
T ston(string& str, T n){
  istringstream sin(str) ;
  T num ;
  sin >> num ;
  return num ;
}

void Ans(bool f){
  if(f) cout << "YES"<<endl;
  else cout << "NO"<<endl;
}

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll n,m ,p;
  while(cin >> n >> m >> p && n && m && p){
    vary(double,x,n,0);
    double pool = 0;
    rep(i,n){
      cin >> x[i];
      pool += x[i];
    }
    pool *= 100-p;
    if(x[m-1])
      cout << int(pool / x[m-1])<<endl;
    else
      cout << 0 << endl;
  }
  return 0;
}

C++: #include <stdio.h>

int main(){

  int m,n,p,i,sum=0,ans=0;
  int x[100]={};
  for(;;){
    
    scanf("%d %d %d",&n,&m,&p);

    if(n==0&&m==0&&p==0){
      break;
    }
    for(i=1;i<=n;i++){
      scanf("%d",&x[i]);
      sum+=x[i];
    }

    if(x[m]!=0){
      ans=(100*sum/x[m])*((100-p)*0.01);
    }

    if(x[m]==0){
      printf("0\n");
    }
    else{
      printf("%d\n",ans);
    }
      ans=0;
      sum=0;
      for(i=1;i<=n;i++){
	x[i]=0;
      }
    }  
    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, atari=0;

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

	return 0;
}

C++: #include <algorithm>
#include <cctype>
#include <cstdio>
#include <iostream>
#include <locale>
#include <numeric>
#include <string>
#include <vector>

using namespace std;

int solve(int n, int m, int p){
    int x[n];
    int sum_x=0;
    int ans;
    for(int i=0;i<n;i++){
        cin >>x[i];
        sum_x+=x[i];
    }
    if(x[m-1]==0)ans=0;
    else ans = sum_x*(100-p)/x[m-1];
    return ans;
}

int main(int argc, char const *argv[]) {
    int n, m, p;
    vector<int>ans;
    while (1) {
        cin >> n >> m >> p;
        if(n == 0 && m == 0 && p == 0)break;
        ans.push_back(solve(n,m,p));
    }
    for(int i=0;i<ans.size();i++){
        cout << ans[i] << endl;
    }
    return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
	int a,b,c,i,d,e,sum;
	while(1){
		sum=0;
	cin>>a>>b>>c;
	if(a==0&&b==0&&c==0)break;
	if(b==0)cout<<0;
	else{
for(i=0;i<a;i++){
cin>>d;
sum+=d;
if(i==b-1)e=d;
}

if(c==100)cout<<0;
else if(c==0)cout<<sum*100/e;
else cout<<(sum*100-sum*c)/e;
}
cout<<endl;
}
return 0;
}

C++: #include <cstdio>
int N,M,P,S,i,X[101];main(){while(true){S=0;scanf("%d%d%d",&N,&M,&P);if(N==0){break;}for(i=1;i<=N;i++){scanf("%d",&X[i]);S+=X[i];}printf("%d\n",X[M]==0?0:(100-P)*S/X[M]);}}