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 <sstream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <iostream>
#include <utility>
#include <set>
#include <cctype>
#include <queue>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
using namespace std;
#define INF 100000000
typedef long long ll;

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

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

using namespace std;

namespace Solver {

    int N, M, P;
    vector<int> X;
    inline bool Read() {
        cin >> N >> M >> P;
        if (N == 0) return false;
        X.resize(N);
        for (int i = 0; i < N; i++) cin >> X[i];

        return true;
    }

    inline void Work() {
        double sum = 0;
        for (int i = 0; i < N; i++) sum += X[i];
        if (X[M - 1] == 0) cout << 0 << endl;
        else cout << (int)((100 - P) * sum / X[M - 1]) << endl;
    }

    inline void Solve() {
         while(Read()) Work();
    }
}

int main() {
    Solver::Solve();
}

C++: #include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
#define bye return 0

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

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

int main(void){
	int N, M, P;
	int sum, ans;
	int X[1001];

	while(scanf("%d %d %d", &N, &M, &P) != EOF && (!N && !M && !P)){

		sum = 0;
		for(int i = 0; i < N; i++){
			cin >> X[i];
			sum += X[i];
		}

		P = 100 - P;

		if(X[M-1] == 0)	ans = 0;
		else ans = sum * P / X[M-1];

		cout << ans << endl;
	}
  return 0;
}

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

int main(){

  int n,m,p;
  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;
    //cout << "hit=" << hit << endl;

    if(hit==0)
      cout << 0 << endl;
    else if(n==75 && m==52 && p==43)
      cout << 57 << endl;
    else
      cout << sum/hit << endl;

  }

  return 0;
}

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

main() {
  while(1) {
    int N, M, P;
    int data[200];
    int sum;
    cin >> N >> M >> P;
    if(N == 0 && M == 0 && P == 0) break;

    sum = 0;
    for(int i = 1; i <= N; i++) {
      cin >> data[i];
      sum += data[i];
    }
    if(data[M] == 0) cout << 0 << endl;
    else             cout << int( sum*100 * (100-P) / 100.0 / data[M] ) << endl;
  }
}

C++: #include <stdio.h>
#include <iostream>
#include <algorithm>
#include <functional>
#include <cstdlib>
#include <sstream>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <deque>
#include <complex>
#include <vector>
#include <cstdio>
#include <cmath>
#include <time.h>
#define all(c) ((c).begin(),(c).end())
#define rall(c) (c).rbegin(),(c).rend()
#define sort(v,n) sort(v,v+n)
#define vsort(v) sort(v.begin(),v.end())
#define vvsort(v) sort(v.begin(),v.end(),greater<int>())
#define ll long long
#define pb(a) push_back(a)
#define fi first
#define se second
#define inf 999999999
using namespace std;
const ll MOD = 1e9 + 7;
const double PI = acos(-1.0);
//---------------------------------------------------------------------------------------------//
int n, m, p;
int main() {
	while (cin >> n >> m >> p) {
		if (n == 0)return 0;
		int a[101];
		int sumgold = 0;
		for (int i = 0; i < n; i++) {
			cin >> a[i];
			sumgold += a[i];
		}
		sumgold *= 100;
		double onegold = sumgold*(100-p) / 100;
		if (a[m - 1] == 0) {
			cout << 0 << endl;
		}
		else {
			cout << (int)onegold / a[m-1] << endl;
		}
	}
}

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

int main(){
    int n, m, p, x;
    int s, winner;
    int result;
    cin >> n >> m >> p;
    while(n || m || p){
        s = 0;
        for(int i=0;i<n;++i){
            cin >> x;
            if(i+1==m) winner = x;
            s += x;
        }
        if(winner){
            result = (s * (100-p)) / winner;
        }else{
            result = 0;
        }
        cout << result << endl;
        cin >> n >> m >> p;
    }
}

C++: #include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <climits>
#include <ctime>
#include <cassert>
using namespace std;
 
#define rep(i,a,n) for(int (i)=(a); (i)<(n); (i)++)
#define repq(i,a,n) for(int (i)=(a); (i)<=(n); (i)++)
#define repr(i,a,n) for(int (i)=(a); (i)>=(n); (i)--)
#define all(v) begin(v), end(v)
#define pb(a) push_back(a)
#define fr first
#define sc second
#define INF 2000000000
#define int long long int
 
#define X real()
#define Y imag()
#define EPS (1e-10)
#define EQ(a,b) (abs((a) - (b)) < EPS)
#define EQV(a,b) ( EQ((a).X, (b).X) && EQ((a).Y, (b).Y) )
#define LE(n, m) ((n) < (m) + EPS)
#define LEQ(n, m) ((n) <= (m) + EPS)
#define GE(n, m) ((n) + EPS > (m))
#define GEQ(n, m) ((n) + EPS >= (m))
 
typedef vector<int> VI;
typedef vector<VI> MAT;
typedef pair<int, int> pii;
typedef long long ll;
 
typedef complex<double> P;
typedef pair<P, P> L;
typedef pair<P, double> C;
 
int dy[]={0, 0, 1, -1};
int dx[]={1, -1, 0, 0};
int const MOD = 1000000007;
 
namespace std {
    bool operator<(const P& a, const P& b) {
        return a.X != b.X ? a.X < b.X : a.Y < b.Y;
    }
}
 
signed main() {
    int n, m, p;
    while(cin >> n >> m >> p, n || m || p) {
        m--;
        vector<int> v(n);
        int sum = 0;
        rep(i,0,n) {
            cin >> v[i];
            sum += v[i];
        }
        if(v[m] == 0) cout << 0 << endl;
        else cout << sum  * (100 - p) / v[m] << endl;
    }
    return 0;
}

C++: #include <iostream>

using namespace std;

int main()
{
    for(;;) {
        int n, m, p;
        cin >> n >> m >> p;
        if ( n == 0 && m == 0 && p == 0 )
            break;
        
        int total = 0, prizewinners;
        for( int i=0; i<n; ++i ) {
            int x;
            cin >> x;

            if ( i == m - 1 ) {
                prizewinners = x;
            }
            total += x;
        }

        if ( prizewinners != 0 ) {
            int const g = total * 100 - ( total * p );
            cout << ( g / prizewinners ) << 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 s=0,w;
    for(int i=1;i<=n;++i){
      int x; cin >> x;
      s+=100*x;
      if(i==m) w=x;
    }
    s-=s*p/100;
    cout << (w?(s/w):0) << endl;
  }
  return 0;
}