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

int main(){

  int n, m, p;
  bool flag = true;
  
  while(cin >> n >> m >> p && n && m && p){
    int sum=0, x, win;
    for(int i=0; i<n; i++){
      cin >> x;
      sum+=x;
      if(m==i+1){
        win=x;
        if(win==0){
          cout << 0 << endl;
          flag = false;
          break;
        }
      }
    }
    if(flag){
      sum = sum * (100-p);
      int ans = sum / win;
      cout << ans << endl;
    }
    sum=0;
    flag = true;
  }

  return 0;
}

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

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

  while((cin>>n>>m>>p)&&(n!=0)&&(m!=0)&&(p!=0)){
    vector<int> x(n);
    int sum=0;
    for(int i=0;i<n;i++){
      cin >> x[i];
      sum += x[i];
    }

    if(x[m-1]==0) cout << 0 << endl;
    else{
      int all_money=sum*100;
//      cout << "all " << all_money << endl;
      int nokorinokane=all_money-(int)((double)all_money*((double)p/100.0));
 //     cout << nokorinokane << endl;
      int haitou=nokorinokane/x[m-1];
      cout << haitou << endl;
    }
  }
  return 0;
}

C++: #include <iostream>

using namespace std;

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

  while(1){
    int max=0;
    cin>>N>>M>>P;
    
    if(N==0 && M==0 && P==0)
      break;

    int X[]={0};

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

    max=max*(100-P);

    if(X[M-1]==0)
      cout<<0<<endl;
    else
      cout<<max/X[M-1]<<endl;
  }

  return 0;
}

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

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);

	for(int n, m, p; cin >> n >> m >> p, n;) {
		vector<int> num(n);
		for(int i = 0; i < n; ++i)
			cin >> num[i];

		const int sum = accumulate(num.begin(), num.end(), 0);
		if(num[m - 1])
			cout << sum * (100 - p) / num[m - 1] << endl;
		else
			cout << 0 << endl;
	}

	return EXIT_SUCCESS;
}

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

using namespace std;

int main(int argc, char **argv)
{
  int n, m, *a, t, p;

  while(1){
    cin >> n >> m >> p;
    if(n == 0 && m == 0 && p == 0){
      break;
    }
    a = (int *)calloc(n+1, sizeof(int));
    t = 0;
    for(int i = 1; i <= n; i++){
      cin >> a[i];
      t += a[i]*100;
    }
    if(a[m] == 0){
      cout << a[m] << endl;
      free(a);
      continue;
    }
    t -=(t*p/100);
    t /= a[m];
    cout << t << endl;

    free(a);
  }

  return 0;
}

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

using namespace std;

typedef long long ll;
typedef long double ld;
typedef tuple<int, int> duo;
const int dx[] = {0, 0, 1, -1, 1, 1, -1, -1};
const int dy[] = {1, -1, 0, 0, 1, -1, 1, -1};
const int Mod = 1000000000 + 0;
//{{{ templates
#define TT_ template<typename T>inline
#define TTF_ template<typename T,typename F>inline
TT_ T sq(T x){return x*x;}
TT_ T In(){T x;cin>>x;return x;}
TT_ void Out(T&x){cout<<x;}
TT_ void sort(T&v){sort(begin(v),end(v));}
TT_ void revs(T&v){reverse(begin(v),end(v));}
TT_ void uniq(T&v){sort(v);v.erase(unique(begin(v),end(v)),end(v));}
TT_ int ubnd(T&v,typename T::value_type&x){return upper_bound(begin(v),end(v),x)-begin(v);}
TT_ int lbnd(T&v,typename T::value_type&x){return lower_bound(begin(v),end(v),x)-begin(v);}
TTF_ void inpt(T&v,int n,F f){for(v.reserve(n);n--;v.emplace_back(f()));}
TTF_ void show(T&v,F f,string d=" ",string e="\n"){int i=0;for(auto&x:v)i++&&(cout<<d),f(x);cout<<e;}
TT_ typename T::iterator minel(T&v){return min_element(begin(v),end(v));}
TT_ typename T::iterator maxel(T&v){return max_element(begin(v),end(v));}

inline void fast_io(){ios::sync_with_stdio(0);cin.tie(0);}
inline int in(){int x;scanf("%d",&x);return x;}
inline ll pow_mod(ll a,ll k,ll m){ll r=1;for(;k>0;a=a*a%m,k>>=1)if(k&1)r=r*a%m;return r;}
inline ll mod_inv(ll a,ll p){return pow_mod(a,p-2,p);}
//}}} priority_queue queue deque front stringstream max_element min_element insert count make_tuple

int main()
{
  int N, M, P;
  while (cin >> N >> M >> P, N || M || P){
    int tot = 0;
    vector<int> v;
    inpt(v, N, in);
    for (auto& x : v) tot += x * 100;
    M--;
    tot -= P * (tot / 100);
    if (v[M]) printf("%d\n", tot / v[M]);
    else printf("0\n");
  }
  return 0;
}

C++: #include <iostream>
#include <fstream>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <stack>

#define rep(i,x) for(int i=0;i<x;i++)
#define rrep(i,x) for(int i=x-1;i>=0;i--)
#define rep_to(a,i,x) for(int i=a;i<x;i++)

using namespace std;

int main()
{
	int N,M,P;
	while(cin >> N >> M >> P && N)
	{
		int x[10000]={};
		int sum=0;

		rep(i,N)
		{
			cin >> x[i];
			sum+=x[i]*100;
		}

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

C++: // 2008_PrincessGamble.cpp
//
#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 110;

int n, m, p, pool, sum, result;
int x[MAX_N];

int main() {
  while(cin >> n >> m >> p) {
    sum = 0; result = 0;
    if(n == 0 && m == 0 && p == 0) break;

    for(int i = 1; i <= n; ++i) {
      cin >> x[i];
      sum += x[i] * 100;
    }
    if(x[m] != 0) {
      pool = sum * (100 - p) / 100;
      result = pool / x[m];
    }
    cout << result << endl;
  }
  return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
template <class T> inline bool chmax(T &a, T b) {
    if(a < b) {
        a = b;
        return 1;
    }
    return 0;
}
template <class T> inline bool chmin(T &a, T b) {
    if(a > b) {
        a = b;
        return 1;
    }
    return 0;
}
using ll = long long;

#define ALL(v) (v).begin(), (v).end()
#define RALL(v) (v).rbegin(), (v).rend()
#define endl "\n"
const double EPS = 1e-7;
const int INF = 1 << 30;
const ll LLINF = 1LL << 60;
const double PI = acos(-1);
constexpr int MOD = 1000000007;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};

//-------------------------------------

bool solve() {
    int n, m, p;
    cin >> n >> m >> p;
    m--;
    if(n == 0) {
        return 0;
    }
    vector<int> x(n);
    for(int i = 0; i < n; i++) {
        cin >> x[i];
    }
    int sum = accumulate(ALL(x), 0);
    if(x[m] == 0) {
        cout << 0 << endl;
    } else {
        cout << ((100 - p) * sum / x[m]) << endl;
    }
    return 1;
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    while(1) {
        if(!solve()) {
            break;
        }
    }
}

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

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

#define REP(i,n) for(int i=0;i<(n);i++)
#define ALL(v) (v).begin(),(v),end()
#define pb push_back
typedef long long ll;
typedef pair<int,int> P;

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;}
//-----------------------------------------------------------------------

int main()
{   
    cin.tie(0);
    ios::sync_with_stdio(false);

    while(true)
    {
        int n,m,p,X[100]={0};
        cin>>n>>m>>p;
        if(n+m+p==0) break;
     
        int num=0;
        REP(i,n) cin>>X[i],num+=X[i];
        if(X[m-1]==0) cout<<0<<endl;
        else cout<<(100-p)*num/X[m-1]<<endl;
    }
}