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 <cstdio>
#include <iomanip>

#include <vector>
#include <map>
#include <set>
#include <queue>
#include <bitset>
#include <stack>
#include <utility>

#include <numeric>
#include <algorithm>
#include <functional>

#include <cctype>

#include <complex>
#include <string>
#include <sstream>

using namespace std;

#define all(c) c.begin(),c.end()
#define rall(c) c.rbegin(),c.rend()
#define rep(i,n) for(unsigned int i=0;i<(n);i++)
#define tr(it,container) for(typeof(container.begin()) it = container.begin(); \
                                                  it != container.end(); ++it)

typedef long long ll;
typedef complex<double> P;
const int dx[] = {1,0,-1,0};
const int dy[] = {0,-1,0,1};
const double EPS = 1e-9;
const int days[] = {31,28,31,30,31,30,31,31,30,31,30,31};
const int daysleap[] = {31,29,31,30,31,30,31,31,30,31,30,31};

int main(){
    while(true){
        int N,M,P;
        cin >> N >> M >> P;
        if(N==0) break;
        vector<int> X(N);
        rep(i,N) cin >> X[i];
        int total = accumulate(all(X),0);
        double rest = 100 * total * ((100-P)/100.0);

        double ret = rest / X[M-1];
        cout << floor(ret) << endl;
        return 0;
    }
}

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

#define FOR(i,s,t) for(int i =s ; i <t ; i++)

void solve() {
	int N, M, P;
	while (cin>>N>>M>>P,N){
		vector<int>a(N);
		FOR(i, 0, N) {
			cin >> a[i];
		}
		long long sum = accumulate(a.begin(), a.end(), 0LL);
		M--;
		sum *= 100;
		if (a[M] == 0)cout << 0 << endl;
		else 		cout << max(0LL, sum *(100-P)/ a[M]/100) << endl;

	}

}

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

	solve();

	return 0;
}

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

main(int argc, char const *argv[])
{
	int n,m,p;
	while(cin>>n>>m>>p,n)
	{
		int x,s=0,w;
		for (int i = 0; i < n; ++i)
		{
			cin>>x;
			s+=x;
			if(i==m-1) w=x;
		}
		s*=100;
		if(w>0)	cout<<s*(100-p)/100/w<<endl;
		else cout<<"0\n";
	}
	return 0;
}

C++: #include<iostream>
#include<math.h>
using namespace std;
int main()
{
	int n, m, p;
	int x[101];
	while (cin >> n >> m >> p && n != 0 && m != 0 && p != 0)
	{
		int sum = 0;
		for (int i = 1; i <= n; i++)
		{
			cin >> x[i];
			sum += x[i];
		}
		if (x[m] == 0)
		{
			cout << 0 << endl;
			continue;
		}
		sum *= 100;
		int ans = floor((sum / x[m]) - (sum / x[m]) * (p * 0.01));
		cout <<  ans << endl;

	}
	return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <cmath>
#include <string>
#include <sstream>
#include <iomanip>
#include <complex>
using namespace std;

#define ll long long
#define vvi vector< vector<int> >
#define All(X) X.begin(),X.end()
#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define pb push_back 
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}

int n,m,p;

int main(){
	while(1){
		cin >> n >> m >> p;
		if(n==0&&m==0&&p==0) break;
		int sum = 0;
		int waru;
		REP(i,n){
			int tmp;
			cin >> tmp;
			if(i==m-1) waru = tmp;
			sum += tmp;
		}
		if(waru==0) cout << 0 << endl;
		else cout << sum*100*(100-p)/100/waru << endl;
	}
}

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;
         goto a;
	}else {
          cout<<0<<endl;
          goto a;
	}
      }
    }
  a:{}
  }
  return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cctype>
#include <climits>
#include <bitset>
using namespace std;
typedef long double ld;
typedef long long int ll;
typedef unsigned long long int ull;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<string> vs;
typedef vector<pair<int,int> > vpii;
typedef vector<vector<int> > vvi;
typedef vector<vector<char> > vvc;
typedef vector<vector<string> > vvs;
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define fin(ans) cout<<(ans)<<endl
#define P 1000000007
#define STI(s) atoi(s.c_str())//string to int
#define mp(p,q) make_pair(p,q)
#define Sort(a) sort(a.begin(),a.end())
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;}
const int INF = INT_MAX;
const long long LLINF = 1LL<<60;
//g++ -std=c++1z temp.cpp
//./a.out


int main(void){ios::sync_with_stdio(false);cin.tie(0);
//////////////////////////////////////////////////////
    int n,m,p;
    while(1){
        cin>>n>>m>>p;
        if(n==0&&m==0&&p==0)break;
        int x[n];
        double sum=0;
        rep(i,n){
            cin>>x[i];
            sum+=x[i];
        }
        sum=sum*(100-p);
        if(x[m-1]==0){
            cout<<0<<endl;
            continue;
        }
        sum/=x[m-1];
        cout<<floor(sum)<<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 v[101];
int main(){
  int N,M;
  float P;

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

C++: #include<iostream>
using namespace std;
int main(){
	int N,M,P;
	while(cin>>N>>M>>P){
		if(N==0)break;
		int c=0;
		int d[1100]={},cn=0;
		for(int i=1;i<=N;i++){
			cin>>c;
			d[i]=c;
			cn+=c;
		}
		if(d[M]==0){
			cout<<0<<endl;
		}
		else{
			cout<<((cn*(100-P))-((cn*(100-P))%d[M]))/d[M]<<endl;
		}
	}
	return 0;
}