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 sum=0,num[101];
		for(int i=1;i<=n;i++){
			cin>>num[i];
			sum+=num[i];
		}
		sum*=(100-p);
		sum/=num[m];
		if(num[m])cout<<sum<<endl;
		else cout<<0<<endl;
	}
}

C++: #define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES

#include "bits/stdc++.h"
#define REP(i,a,b) for(int i=a;i<b;++i)
#define rep(i,n) REP(i,0,n)
#define ll long long
#define ull unsigned ll
typedef long double ld;
#define ALL(a) (a).begin(),(a).end()
#define ifnot(a) if(not a)
#define dump(x)  cerr << #x << " = " << (x) << endl
using namespace std;

void reader(int &a) { scanf("%d", &a); }
void reader(double &a) { scanf("%lf", &a); }
void reader(char a[]) { scanf("%s", a); }
void reader(char &a) { scanf(" %c", &a); }
void reader(ll &a) { scanf("%lld", &a); }
void reader(ull &a) { scanf("%llu", &a); }
// void reader(string& a){cin >> a;};
template<class T, class U> void reader(T& t, U& u) { reader(t); reader(u); }
template<class T, class U, class V> void reader(T& t, U& u, V& v) { reader(t); reader(u); reader(v); }

void writer(const int a, char c) { printf("%d", a); putchar(c); }
void writer(const ll a, char c) { printf("%lld", a); putchar(c); }
void writer(const ull a, char c) { printf("%llu", a); putchar(c); }
void writer(const double a, char c) { printf("%.20lf", a); putchar(c); }
void writer(const char a[]) { printf("%s", a); };
void writer(const char a[], char c) { printf("%s", a); putchar(c); };
void writer(const char a, char c) { putchar(a); putchar(c); };
template<class T> void writerLn(T t) { writer(t, '\n'); }
template<class T, class U> void writerLn(T t, U u) { writer(t, ' '); writer(u, '\n'); }
template<class T, class U, class V> void writerLn(T t, U u, V v) { writer(t, ' '); writer(u, ' '); writer(v, '\n'); }
template<class T> void writerArr(T x[], int n) { int i; if (!n) { putchar('\n'); return; }rep(i, n - 1) writer(x[i], ' '); writer(x[n - 1], '\n'); }
template<class T> void writerVec(vector<T> x) { int n = x.size(); int i; if (!n) { putchar('\n'); return; }rep(i, n - 1) writer(x[i], ' '); writer(x[n - 1], '\n'); }

vector<string> split(const string &str, char sep) { vector<string> v; stringstream ss(str); string buffer; while (getline(ss, buffer, sep)) { v.push_back(buffer); }return v; }
// #define int ll
bool test = 1;
int dx[] = { 0,1,0,-1 };
int dy[] = { 1,0,-1,0 };
#define MAX 300000
//.....................
ull mod = (int)1e9 + 7;

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

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

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

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-1]) {
			cout << 0 << endl;
		} else {
			cout << (int)(100-P)*sum/X[M-1] << endl;
		}
	}

	return 0;
}

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

using namespace std;

#define rep(i, n) for (int i = 0; i < (int)(n); ++i)

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

   int n, m, p;
   while(cin >> n >> m >> p){
      int a[n], buy = 0;
      if(n == 0 && m == 0 && p == 0) break;
      rep(i,n){
         cin >> a[i];
         buy += a[i];
      }
      if(a[m - 1] == 0) cout << 0 << endl;
      else cout << (100 * buy - buy * p) / a[m - 1] << endl;
   }

   return 0;
}

C++: #include<iostream>

using namespace std;

int main(){
  int N,M,P,X[1000];
  double 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.0-P*0.01);
        kane=kane/X[M-1];

        cout<<(int)kane<<endl;
      }
      kane=0;
      kazu=0;
      for(int lop=0;lop<N;lop++){
          X[lop]=0;
      }
  }

  return 0;
}

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

using namespace std;

int main(){

  int n,m,p;

  while(cin>>n>>m>>p,n||m||p){

	vector<int> x(n+1);
	int total=0;
	
	for(int i=1;i<=n;++i){
	  cin>>x[i];
	  total+=x[i];
	}
	
	total=total*(100-p)
	
	if(x[m]==0)
	  cout<<0<<endl;
	else{
	  double tmp = total/x[m];
	  cout<<(int)total<<endl;
	}
  }

}

C++: // AOJ 2018

#include <iostream>

using namespace std;

int main(void)
{
	int n, m, p, x;
	while(cin >> n >> m >> p, n && m){
		int win = 0, money, sum = 0;
		
		for (int i = 1; i <= n; i++){
			cin >> x;
			if (i == m) win = x;
			sum += x;
		}

		money = sum * 100;
		money -= (int)(money * (p / 100.0));
		// cout << money << endl;

		cout << (win == 0 ? 0 : money / win) << endl;
	}

	return 0;
}

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[110], sum = 0;
        for (int i = 1; i <= N; i++) {
            cin >> X[i];
            sum += X[i];
        }
        if (X[M] == 0) {
            cout << 0 << endl;
            continue;
        }
        sum = sum * (100 - P);
        cout << sum / X[M] << endl;
    }
    return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <queue>
#include <algorithm>
#define INF 100000000
using namespace std;

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

  while( cin >> n >> m >> p,n+m+p ){

    double sum = 0;
    int a[101] = {0};

    for(int i = 0 ; i < n ; i++ ){
      cin >> a[i];
      sum += a[i];
    }
    if(a[m-1] == 0){
      cout << 0 << endl;
      continue;
    }
    sum =100*(sum*(1.0-(p/100.0)));
    int ans = (int)(sum/a[m-1]);
    printf("%d\n",ans);
  }
  return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
using vi=vector<int>;
using vvi=vector<vi>;
using vs=vector<string>;
#define rep(i,n) for(int i=0;i<n;i++)
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()

int main(void){
    int n,m,p;
    while(cin>>n>>m>>p,n){
        double t=0,h=0;
        rep(i,n){
            int s; cin>>s;
            if(i+1==m)h=s;
            t+=s;
        }
        cout<<floor(h?t*p/h:0)<<endl;
    }
}