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>
#include <iostream>
#include <string>
#include <cmath>
#include <vector>
#include <cstring>
#include <climits>
#include <queue>
#include <algorithm>
#include <utility>
#define INF INT_MAX / 2
using namespace std;

typedef pair<int, int> P;
typedef long long ll;

int main(void) {
	int N,M,P;
	while(cin >> N >> M >> P,N+M+P!=0){
	double sum = 0;
	vector<double> x(N);
	for(int i=0;i<N;i++){
		cin >> x[i];
		sum += x[i];
	}
	sum *= 100;sum *= (1-1.*P/100);
	if(x[M-1] == 0)cout << 0 << endl;
	else printf("%d\n",(int)(sum / x[M-1]));
}
}

// command shift d duplicate
// command ctrl 上下
// command D
// command caps G → '' ""
// vector<vector<int>> a(N,vector<int>(M,-1));

C++: #include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<cassert>
#include<iostream>
#include<sstream>
#include<string>
#include<vector>
#include<queue>
#include<set>
#include<map>
#include<utility>
#include<numeric>
#include<algorithm>
#include<bitset>
#include<complex>

using namespace std;

typedef long long Int;
typedef vector<int> vint;
typedef pair<int,int> pint;
#define mp make_pair

template<class T> void pv(T a, T b) { for (T i = a; i != b; ++i) cout << *i << " "; cout << endl; }
template<class T> void chmin(T &t, T f) { if (t > f) t = f; }
template<class T> void chmax(T &t, T f) { if (t < f) t = f; }
int in() { int x; scanf("%d", &x); return x; }

int x[110];

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

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

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

C++: #include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <cstring>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <fstream>
#include <complex>
#include <stack>
#include <queue>

using namespace std;
typedef long long LL;
typedef pair<int, int> PII;
static const double EPS = 1e-5;

#define FOR(i,k,n) for (int i=(k); i<(int)(n); ++i)
#define REP(i,n) FOR(i,0,n)

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

C++: #include<iostream>
#include<cstring>
#include<algorithm>
#include<string>
#include<vector>
#include<cstdio>
#include<cmath>
#define pb(in,tmp) in.push_back(tmp)
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,b) loop(i,0,b)
#define all(in) in.begin(),in.end()
const double PI=acos(-1);
using namespace std;
int main(){
  int n,m,p;
  while(cin>>n>>m>>p,n||m||p){
    double ans=0;
	vector<int>in(n);
	rep(i,n){cin>>in[i];ans+=in[i]*100;}
	if(!in[m-1])cout<<0<<endl;
	else{
	  ans*=(100.0-p)/100.0;
	  ans/=in[m-1];
	  cout<<(int)ans<<endl;
    }
  }
}

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

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

	while(cin>>n>>m>>p && (n || m || p)){
		int x[104],sum=0;

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

		sum = (int)(sum * ((100.0 - p) / 100.0));

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

	return 0;
}

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

int main()
{
  int N,M,i;
  double P,X,S,m;
  while(cin>>N>>M>>P){
    S=0.0;
    for(i=0;i<N;i++){
      cin>>X;
      S+=100.0*X;
      if(i==M-1)m=(double)M;
    }
    S*=(100.0-P)/100.0;
    if(m)cout<<(int)(S/m)<<endl;
    else puts("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 * (1.0 - P) / X[M] + 0.1) << endl;
        }
    }
}

C++: #include <algorithm>
#include <iostream>
#include <string>
#include <vector>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;

int main() {
  int n, m, p;
  while (cin >> n >> m >> p && n && m && p) {
    int sum = 0;
    int dl[n];
    rep(i, n) {
      cin >> dl[i];
      sum += dl[i];
    }
    if (dl[m - 1] == 0) {
      cout << 0 << endl;
    } else {
      cout << sum * (100 - p) / dl[m - 1] << endl;
    }
  }
  return 0;
}

C++: #include <iostream>
#include <vector>
using namespace std;
int main(void){
  int n, m, p, total, ans;
  while(true){
    cin >> n >> m >> p;
    if(n == 0 && m == 0 && p == 0){
      break;
    }
    vector<int> x(n, 0);	
    for(int i = 0; i < n; i++){
      cin >> x[i];
    }
    total = 0;
    for(int i = 0; i < n; i++){
      total = total + x[i];
    }	
    total = total * 100;
    if(x[m - 1] == 0){ 
      cout << 0 << endl;
      continue;
    }
    int rem = (total * (100 - p)) / 100;
    cout << rem / x[m-1] << endl;
  }
  return 0;
}

C++: #include <bits/stdc++.h>

#define FOR(i, a, b) for(long long int i=(a);i<=(b);i++)
#define RFOR(i, a, b) for(long long int i=(a);i>=(b);i--)
#define MOD 1000000007
#define INF 1000000000 //2000000000
#define LLINF 1000000000000000000 //9000000000000000000
#define PI 3.14159265358979

using namespace std;
typedef long long int ll;
typedef pair< long long int, long long  int> P;

int main(void) {
	
	while (1) {
		int n, m, p;
		int money = 0;
		int x[101] = {};

		cin >> n >> m >> p;
		if (n == 0 && m == 0 && p == 0) {
			break;
		}
		FOR(i, 1, n) {
			cin >> x[i];
			money += x[i];
		}
		money *= (100 - p);
		if (x[m] == 0) {
			cout << 0 << endl;
		}
		else {
			cout << money / x[m] << endl;
		}
	}
}

C++: #include<iostream>
using namespace std;
int main(){
int n,m,p,x[100],a,ans;
while(1){
a=0;
cin>>n>>m>>p;
if((n+m+p)==0)break;
 for(int i=1;i<=n;i++){
cin>>x[i];
a+=x[i];
}
if(x[m]==0)cout<<0;
else{
ans=a*(1-p)/x[m];
cout<<ans;
}
}
return 0;
}