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 <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <fstream>
#include <queue>

#pragma warning( disable: 4996 )

using namespace std;

typedef long long ll;

#define INF 1000000000
#define EPS 1e-10

#define MAX_N 100
#define MAX_M 100
#define MAX_P 100

int N, M, P;
int X[MAX_N];

vector<int> ans_list;

int main(){

	while (true){
		cin >> N >> M >> P;
		if (N == 0 && M == 0 && P == 0)
			break;

		int sum = 0;

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

		double money = 100 * sum;

		money = money * (100 - P) / 100;

		if (X[M - 1] != 0)
			ans_list.push_back(money / X[M - 1]);
		else
			ans_list.push_back(0);

	}

	for (int i = 0; i < ans_list.size(); i++){
		cout << ans_list[i] << endl;
	}

	return 0;

}

C++: #include <bits/stdc++.h>
#define syosu(x) fixed<<setprecision(x)
using namespace std;
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef pair<double,double> pdd;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<string> vs;
typedef vector<P> vp;
typedef vector<vp> vvp;
typedef vector<pll> vpll;
typedef pair<int,P> pip;
typedef vector<pip> vip;
const int inf=1<<29;
const ll INF=1ll<<60;
const double pi=acos(-1);
const double eps=1e-11;
const ll mod=1e9+7;
const int dx[4]={-1,0,1,0},dy[4]={0,-1,0,1};

int f(int i,int x){
	return i*(100+x)/100;
}

int main(){
	while(1){
		int n,m,p,t=0;
		cin>>n>>m>>p;
		if(n==0) break;
		vi a(n);
		for(auto &i:a){
			cin>>i;
			t+=i;
		}
		cout<<(a[m-1]?t*(100-p)/a[m-1]:0)<<endl;
	}
}

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

using namespace std;

int main(){
    while(true){
        // N, M, P ?????\???
        int n, m, p;
        cin >> n >> m >> p;

        // 0 0 0 ????????????
        if(n == 0 && m == 0 && p == 0)
            return 0;

        //x ?????\???
        vector<int> x(n);
        for(auto &a:x)
            cin >> a;

        // ????????????????????????
        if(x[m - 1] == 0){
            cout << 0 << endl;
            continue;
        }

        //????¨??????????
        int sum = accumulate(x.begin(), x.end(), 0) * 100;
        //?????????????????????
        double total = sum * (100 - p) / 100;
        //????????????
        int money = total / x[m - 1];

        cout << money << endl;
    }

    return 0;
}

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

int solve(int n, int m, int p) {
    int a[n];
    int ret = 0;
    for (int i = 0; i < n; i++) {
        cin >> a[i];
        ret += 100*a[i];
    }
    if (a[m-1]) ret = ret * (100-p)/100 / a[m-1];
    else ret = 0;
    return ret;
}

int main(void){
    int n, m, p;
    vector<int> ans;
    while (1) {
        cin >> n >> m >> p;
        if (!n && !m && !p) break;
        ans.push_back(solve(n, m, p));
    }
    for (auto &i: ans) {
        cout << i << endl;
    }
}

C++: #include <cstdio>

#define rep(i, j) FOR(i, 0, j)
#define FOR(i, j, k) for(int i = j; i < k; ++i)

using namespace std;

int main(){
  int n, m, p, x[101];
  while(scanf("%d%d%d", &n, &m, &p) && (n || m || p)){
    int sum = 0;
    rep(i, n){
      scanf("%d", x+i);
      sum += x[i];
    }

    if(x[m-1] != 0) printf("%d\n", sum *(100-p)/ x[m-1]);
    else printf("0\n");
  }
  return 0;
}

C++: #pragma GCC optimize("O3")
#include<bits/stdc++.h> 
using namespace std;
using ll=long long;
typedef  unsigned long long int ull;
typedef pair<ll,ll> P;
template<class T> using V=vector<T>; 
#define fi first
#define se second
#define all(v) (v).begin(),(v).end()
const ll inf=(1e18);
//const ll mod=998244353;
const ll mod=1000000007;
//ios_base::sync_with_stdio(false);
//cin.tie(NULL);
ll gcd(ll a,ll b) {return b ? gcd(b,a%b):a;}
ll lcm(ll c,ll d){return c/gcd(c,d)*d;}
struct __INIT{__INIT(){cin.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(15);}} __init;
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }
int main(){
ll n,m,p;
while(1){
    cin>>n>>m>>p;
    if(n==0||m==0)return 0;
    V<ll> a(n,0);
    ll sum=0;
    for(int i=0;i<n;i++){
        cin>>a[i];
        sum+=a[i];
    }
   if(a[m-1]==0)cout<<0<<endl;
   else cout<<sum*(100-p)/a[m-1]<<endl;
  }
}

C++: #include <iostream>
using namespace std;
#define rep(i,n) for(int i = 1 ; i <= n ; i++)

int main(){
  while(true){
    int n, m, p;
    cin >> n >> m >> p;
    if(n == 0 && m == 0 && p == 0)break;
    int x[1000];
    x[0] = 0;
    int gol = 0;
    int h = 0;
    double kekka = 0.0;
    
    rep(i, n){
      cin >> x[i];
      h += x[i];
      gol += 100 * x[i];
    }
    kekka = gol - gol*p/100;
    int ans = 0;
    rep(i, n){
      if(x[i] == 0){
	ans = 0;
	break;
      }
      if(i == m && m != 0){
	ans = (int)kekka/x[i];
      }
    }
    cout << ans << '\n';
  }
}

C++: #include <algorithm>
#include <iostream>
#include <string>
#include <vector>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;

int main() {
  int n, m, p;
  while (cin >> n >> m >> p && n && m && p) {
    int sum = 0;
    vector<int> dl(m);
    rep(i, n) {
      cin >> dl[i];
      sum += dl[i];
    }
    if (dl[m - 1] == 0) {
      cout << 0 << endl;
    } else {
      cout << sum * (100 - p) / dl[m - 1] << endl;
    }
  }
  return 0;
}

C++: #include <stdio.h>

int main(){
    int n,m,p,x[101],i,money,q;
    while(1) {
        q=0;
        scanf("%d %d %d",&n,&m,&p);
        if (n==0&&m==0&&p==0) break;
        for (i=1;i<=n;i++) {
            scanf("%d",&x[i]);
            q+=x[i];
        }
        if (x[m]!=0) {
            money=q*(100-p)/x[m];
            printf("%d\n",money);
        }
        else printf("%d\n",0);
    }
    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 <bits/stdc++.h>
using namespace std;
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
typedef long long ll;
typedef vector<string> vs;
typedef vector<int> vi;

int main()
{
	while (1)
	{
		int n, m, p;
		cin >> n >> m >> p;
		if (n == 0) return 0;

		int win = n * (100 - p);
		int winner = 0;
		rep(i, 0, n)
		{
			int x; cin >> x;
			if (x == m) winner++;
		}

		if (winner == 0)
			cout << 0 << endl;
		else
			cout << win / winner << endl;
	}
}

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

int X[100];

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