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>
using namespace std;

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

C++: #include<iostream>

using namespace std;

int main(){
  int N,M,P,X[1000],kazu=0,kane=0;
  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){
        cout<<0<<endl;
      }else{
        kane=kazu*100;
        kane*=(1-P*0.01);
        kane=kane/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<vector>
using namespace std;
int n,m,p;
vector<int> x;
bool input(){
  x.clear();
  if(!(cin>>n>>m>>p))return false;
  if(n==0&&n==m&&m==p)return false;
  for(int i=0;i<n;i++){
    int tmp;
    cin>>tmp;
    x.push_back(tmp);
  }
  return true;
}

int solve(){
  int all=0;
  for(int i=0;i<x.size();i++){
    all+=x[i];
  }
  int hit = x[m-1];
  all*=(100-p);
  if(hit==0)return 0;
  else return all/hit;
}

int main(){
  while(input())cout<<solve()<<endl;
}

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];
		}
		sum*=100-p;
		sum/=num;
		if(num[m])cout<<max(sum,100)<<endl;
		else cout<<0<<endl;
	}
}

C++: #include <bits/stdc++.h>
using namespace std;
#define FOR(i, s, n) for(int i = s; i < (int)n; i++)
#define per(i, n) for(int i = n; i >= 0; i--)
#define ROF(i, s, n) for(int i = s; i >= (int)n; i--)
#define FORIT(i, A) for (auto i : A)
#define PRINT(x) cout << (x) << "\n"
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define MP make_pair
#define EACH(i, n) for (__typeof((n).begin()) i = (n).begin(); i != (n).end(); ++i)
#define SZ(a) int((a).size())
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define CLR(a) memset((a), 0 ,sizeof(a))
#define dump(x) cout << #x << " = " << (x) << "\n";
#define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << "\n";
#define sq(n) (n) * (n)
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
typedef vector<LL> VLL;
typedef vector<VLL> VVLL;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef priority_queue<int> maxpq;
typedef priority_queue< int, vector<int>, greater<int> > minpq;
static const double EPS = 1e-10;
static const double PI = acos( -1.0 );
static const int mod = 10007;
static const int INF = 1 << 25;
static const LL LL_INF = 1152921504606846976;
static const int dx[] = { 1, -1, 0, 0,  1, -1,  1, -1 };
static const int dy[] = { 0, 0, 1, -1 , 1,  1, -1, -1 };
static const char Move[] = { 'E', 'W', 'N', 'S' };

int N, M, P, ans;
double Return = 0, percent;
VI X;

int main() {
	while ( ~scanf( "%d %d %d", &N, &M, &P ) && N && M && P ) {
		X.resize( N );
		X.reserve( N );
		percent = ( 100 - P ) * 0.01;
		for ( int i = 0; i < N; i++ ) {
			scanf( "%d", &X[ i ] );
			Return += X[ i ] * 100;
		}
		if ( X[ M - 1 ] ) {
			Return /= X[ M - 1 ];
		}
		else {
			Return = 0;
		}
		Return *= percent;
		ans = Return;
		printf( "%d\n", ans );
	}
	return 0;
}

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

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

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

using namespace std;

int main(){
	int n, m, p;
	while(cin >> n >> m >> p, n || m || p){
		vector<int> x(n);
		int bet = 0;
		
		for(int i = 0; i < n; i++){//input
			cin >> x[i];
			bet += x[i];
		}

		bet = bet * p;
		if(x[m-1] == 0){
			cout << 0 << endl;
		}else{
			double tmp = bet/x[m-1];
			cout << (int)tmp << endl;
		}
	}

	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
#include <iostream>
/*cout <<"Debug"
cout <<x-30<<' '<<y-30<<endl;*/
typedef pair<pair<int ,int>, int> P;
vector<pair<pair<int ,int>, int> > v_ans;
vector<int>v;
vector<long int>v_ansl;
/*taro tenn,hanako_ten,sum*/

bool cmp(P h, P r){
  return h.second < r.second;
}
int main(){
  int N,M;
  float P;

  cin >>N>>M>>P;
  while(N!=0 and M!=0 and P!=0){
    int NUMP = 0;
    int ans = 0;
    for(int i = 0;i < N ; i++){
      int x;
      cin >>x;
      v.push_back(x);
      NUMP += x;
    }
    if(v[M-1] == 0){
      ans = 0;
    }
    else{
    ans = 100*NUMP*(1-P/100)/v[M-1];
  }

    cout <<(int)ans<<endl;
    cin >>N>>M>>P;
    v.clear();
  }
  return 0;
}

C++: # include <iostream>
# include <algorithm>
# include <vector>
# include <string>
# include <set>
# include <map>
# include <cmath>
# include <iomanip>
# include <functional>
# include <utility>
# include <stack>
# include <queue>
# include <list>
using namespace std;
using LL = long long;
constexpr long long MOD = 1000000000 + 7;
constexpr long long INF = 1000000000;
const double PI = acos(-1);

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

C++: #include<iostream>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<utility>
#include<vector>
#include<cmath>
#include<cstdio>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define mp make_pair
#define it ::iterator
#define all(in) in.begin(),in.end()
const double PI=acos(-1);
const double ESP=1e-10;
using namespace std;
int main(){
  int n,a,b;
  while(cin>>n>>a>>b,a||n||b){
    vector<int>in(n);
    rep(i,n)cin>>in[i];
    double sum=0;
    rep(i,n)sum+=in[i];
    sum*=100;
    sum*=(100-b)/100.0;
    sum=(int)sum;
    if(in[a-1]==0)cout<<0<<endl;
    else cout<<(int)(sum/in[a-1])<<endl;
  }

}

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;
  while(cin >>N >>M >>P && N){
    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) <<endl;
  }
  return 0;
}