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>

using namespace std;

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

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

		if (!X[M]) {
			cout << 0 << endl;
		} else {
			cout << ((100-P)*sum)/X[M-1] << endl;
		}
	}

	return 0;
}

C++: #include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <cstring>
#include <sstream>
#include <cassert>
#include <list>
#include <fstream>
using namespace std;
static const double EPS = 1e-5;
typedef long long ll;
typedef pair<int,int> PI;
typedef vector<int> vi;
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif
#define rep(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()
#define mp(a,b) make_pair(a,b)
#define pb(a) push_back(a)
#define F first
#define S second


int dx[]={0,1,0,-1};
int dy[]={1,0,-1,0};



main(){
  int n,m,p;
  while(cin>>n>>m>>p,n|m|p){
    int sum=0,mt,t;
    rep(i,n){
      cin>>t;
      sum+=t;
      if(i+1==m)mt=t;
    }

    if(mt){
      printf("%d\n",(100-p)*sum/mt);
    }else cout<<0<<endl;
  }
}

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

struct Game {
    int M;
    int N;
    int P;
    std::vector<int> betNum;
};

void cost(Game game); 

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

    std::cin >> M >> N >> P;
    while (M != 0 || N != 0 || P != 0) {
        Game game;
        game.M = M;
        game.N = N;
        game.P = P;

        for (int i = 0; i < game.M; i++) {
            int num;
            std::cin >> num;
            game.betNum.push_back(num); 
        }
        cost(game);
        std::cin >> M >> N >> P;
    }
    return EXIT_SUCCESS;
}

void cost(Game game) {
    int total = 0;
    std::vector<int> v = game.betNum;
    for (int i = 0; i < (int)(v.size()); i ++) {
        total += v[i]; 
    }
    int winner = v[game.N - 1];
    if (winner == 0) {
        std::cout << "0" << std::endl;
    } else {
        std::cout << 100 * total * (100 - game.P) / 100 / winner << std::endl;
    }
    return;
}

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

#define ll long long int
#define ld long double
#define reps(i,f,n) for(int i=f;i<n;i++)
#define rep(i,n) reps(i,0,n)
#define m1 cout<<"move1"<<endl
#define m2 cout<<"move2"<<endl
#define m3 cout<<"move3"<<endl
#define m4 cout<<"move4"<<endl


int main(){
    ld N,P,M;
    vector<ll> v(100,0);
    int ans = 0;
    ld sum = 0;
    ld temp;
    while(cin>>N>>M>>P,N+M+P){
        ans = 0;
        sum = 0;
        rep(i,N){
            cin>>v[i];
            sum += v[i];
        }
        if( v[M -1] != 0){
            temp = (ld)(((ld)sum * 100) * ( 100.0 - (ld)P) * 0.01) / (ld)v[M-1];
            ans=(int)(temp);
        }
        else{ 
            ans = 0; 
        } 
        
        cout<<ans<<endl; 
    } 
    
    return 0; 
}

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

int main(){

  int n,m,p;
  long long sum;    //maisuu
  int hit;
  int x;
  
  while(cin >> n >> m >> p){
    if(n==0&m==0&&p==0){ break; }

    sum = 0;
    hit=0;


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

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

    // cout << "sum=" << sum << endl;

    if(hit==0)
      cout << 0 << endl;
    else
      cout << (int)(sum/hit) << endl;

  }

  return 0;
}

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

#define INF_LL (int64)1e18
#define INF (int32)1e9
#define REP(i, n) for(int i = 0;i < (n);i++)
#define FOR(i, a, b) for(int i = (a);i < (b);i++)
#define all(x) x.begin(),x.end()
#define fs first
#define sc second

using int32 = int_fast32_t;
using uint32 = uint_fast32_t;
using int64 = int_fast64_t;
using uint64 = uint_fast64_t;
using PII = pair<int32, int32>;
using PLL = pair<int64, int64>;

const double eps = 1e-6;

template<typename A, typename B>inline void chmin(A &a, B b){if(a > b) a = b;}
template<typename A, typename B>inline void chmax(A &a, B b){if(a < b) a = b;}

const int64 mod = 1e9+7;

int main(void){
	int32 n, m, p;
	while(cin >> n >> m >> p && n && m && p){
		vector<int32> x(n);
		int32 sum = 0;
		REP(i, n){
			cin >> x[i];
			sum += x[i];
		}
		int32 res = 0;
		if(x[m-1] != 0){
			sum = (sum*100-sum*p);
			while(res*x[m-1] <= sum) res++;
			res--;
		}
		else res = 0;
		cout << res << endl;
	}
}

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

int main(){
	while(1){
		int n, m, p;
		int x[100];
		long sum=0;
		
		scanf(" %d %d %d", &n, &m, &p);
		if(n==0) break;
		for(int i=0; i<n; ++i){
			scanf(" %d", &x[i]);
			sum += x[i];
		}
		sum*=(100-p);
		if(x[m-1]==0)sum=0;	
		else sum/=x[m-1];
		printf("%ld\n", sum);
	}	
	
	return 0;
}

C++: #include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <vector>
#include <string>
#include <queue>
#include <algorithm>
#include <math.h>
#include <utility>
#include <set>
#include <map>
#define INF 1000000000
#define rep(i,n) for(int i =0;i<n;i++)
using namespace std;
typedef long long int ll;


int main(){
    for (;;) {
        int n,m,p;
        cin >> n >> m >> p;
        if(!n and !m and !p)break;
        double sum=0;
        int num=1;
        for (int i=0; i<n; i++) {
            int a;
            cin >> a;
            sum += a*100;
            if(i==m-1)num=a;
        }
        if(num==0){
            cout << 0<<endl;
            continue;
        }
        double rep = sum * (100.0-p) / 100.0;
        int ans = rep/num;
        cout << ans << endl;
    }
}

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

int main (void) {

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

C++: #include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>

#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>

#include <functional>
#include <cassert>

typedef long long ll;
using namespace std;

#define mod 1000000007 //1e9+7
#define INF 1000000000 //1e9
#define LLINF 2000000000000000000LL //2e18
#define SIZE 100


void calc(int n,int m,int p){
  int x[SIZE],c=0;

  for(int i=0;i<n;i++){
    scanf("%d",x+i);
    c += x[i] * (100-p);
  }  

  if(x[m-1]==0)
    puts("0");
  else
    printf("%d\n",c/x[m-1]);
  
  return;
}

int main(){
  int n,m,p;
  
  while(1){
    scanf("%d%d%d",&n,&m,&p);

    if(n==0) break;
    
    calc(n,m,p);
  }

  return 0;
}