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 <queue>
#include <map>
#include <cmath>
#include <algorithm>
#include <queue>
#include <cstdarg>
#include <set>
#include <limits>
#include <iomanip>

using namespace std;
#define INF 2e9 + 9
#define MOD 1000000007
#define ALL(v) v.begin() , v.end()
#define Int int64_t
#define pll pair<Int,Int>
template<class T> using pql = priority_queue<T, vector<T>>;
template<class T> using pq = priority_queue<T, vector<T>, greater<T>>;
#define ll(n) Int n; cin >> n;
#define LL(...) Int __VA_ARGS___; cin >> __VA_ARGS___;
#define OUT(...) cout << __VA_ARGS___;
#define RP(n, i, s) for(Int i = s ;i < n ;i++)
#define REP(n, i) for (Int i = 0; i < n; i++)
#define REPe(n, i) for (Int i = 1; i <= n; i++)
#define RPe(n, i, s) for (Int i = s; i <= n; i++)
#define upd_max(maxer, updater) if (maxer < updater) maxer = updater;

void ansYes(bool flag) {
    if (flag) cout << "Yes" << endl; else cout << "No" << endl;
}

void ansYES(bool flag) {
    if (flag) cout << "YES" << endl; else cout << "NO" << endl;
}

struct node {
    Int to;
    Int length;
};


vector<Int> divisor(Int n) {
    vector<Int> ret;
    for (Int i = 1; i * i <= n; i++) {
        if (n % i == 0) {
            ret.push_back(i);
            if (i * i != n) ret.push_back(n / i);
        }
    }
    return (ret);
}

/*
vector<vector<int>> to;
vector<int> flag;
vector<int> c;


Int dfs(int from, int mae) {
    flag[from] = 1;
    Int mini = 0;
    for (auto next : to[from]) {
        if (next == mae) continue;
        if (flag[next] == 1) {
            return -1;
        } else {
            mini = min(mini, dfs(next, from));
        }
    }
    return mini;
}*/

int dx8[8] = {0, -1, -1, -1, 0, 1, 1, 1};
int dy8[8] = {-1, -1, 0, 1, 1, 1, 0, -1};

int dx[4] = {0, -1, 0, 1};
int dy[4] = {-1, 0, 1, 0};

struct datas {
    Int max;
    Int size;
};

class ContainChecker {
protected:
    Int minx, miny, maxx, maxy;
public:
    ContainChecker(Int minx, Int miny, Int maxx, Int maxy) : minx(minx), miny(miny), maxx(maxx), maxy(maxy) {};

    bool in(Int x, Int y) {
        return (minx <= x && miny <= y && x <= maxx && y <= maxy);
    }
};


int main(void) {
    while (1){
        Int n,m,p;
        cin >> n >> m >> p;
        if (n == 0) break;
        vector<Int> a(n);
        double sum = 0;
        REP(n,i){
           cin >> a.at(i);
           sum += a.at(i) * 100;
        }
        sum = sum / 100 * (100-p);
        m--;
        if (a.at(m) == 0) {
            cout << 0 << endl;
        }else {
            cout << floor(sum / a.at(m)) << endl;
        }
    }
}

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

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


return 0;
}

C++: #include<map>
#include<set>
#include<list>
#include<cmath>
#include<queue>
#include<stack>
#include<cstdio>
#include<string>
#include<vector>
#include<complex>
#include<cstdlib>
#include<cstring>
#include<numeric>
#include<sstream>
#include<iostream>
#include<algorithm>
#include<functional>

#define mp       make_pair
#define pb       push_back
#define all(x)   (x).begin(),(x).end()
#define rep(i,n) for(int i=0;i<(n);i++)

using namespace std;

typedef    long long          ll;
typedef    unsigned long long ull;
typedef    vector<bool>       vb;
typedef    vector<int>        vi;
typedef    vector<vb>         vvb;
typedef    vector<vi>         vvi;
typedef    pair<int,int>      pii;

const int INF=1<<29;
const double EPS=1e-9;

const int dx[]={1,0,-1,0},dy[]={0,-1,0,1};
int n,m,p;
int main(){
  int x;
  while(cin>>n>>m>>p,n||m||p){
    map<int,int> ma;
    int sum = 0;
    for(int i = 1;i <=n;i++){
      cin>>x;
      ma[i]+=x;
      sum +=x*100;
    }
    sum -=(sum*p)/100;
    if(ma[m]==0)
      sum = 0;
    else{
      sum /=ma[m];
    }
    cout <<sum<<endl;
  }
  return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <string>
#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 and n>0){
		int sum=0; int win;
		rep(i,n){
			int x; cin>>x;
			sum+=x;
			if(i+1==m) win=x;
		}
		cout<<(win?sum*(100-p)/win:0)<<endl;
	}
	return 0;
}

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;
      if(m==i+1){
        win=x;
        if(win==0){
          cout << 0 << endl;
          flag = false;
          break;
        }
      }
      sum+=x;
    }
    if(flag){
      sum = sum * (100-p);
      int ans = sum / win;
      cout << ans << endl;
    }
    sum=0;
    flag = true;
  }

  return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
	while(true){
		int gold = 0;
		int n,m,p,mn;
		scanf("%d%d%d", &n, &m, &p);
		if( n == 0 && m == 0 && p == 0 )break;
		for(int i = 0; i < n; ++i){
			int t;scanf("%d", &t);gold += 100 * t;
			if(i==m-1)mn=t;
		}
		gold = gold * (1 - ((double)p/100));
		printf("%d\n", mn > 0 ? (int)(gold / mn) : 0);
	}
	return 0;
}

C++: // AOJ 2018 (http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=2018)
#include<cstdio>
#define rep(i,a) for(int i=0;i<(a);++i)

int N, M, P;

int main()
{
	while( scanf( "%d%d%d", &N, &M, &P ), N|M|P )
	{
		int S = 0, cnt = 0;
		rep( i, N )
		{
			int X;
			scanf( "%d", &X );
			S += X*100;

			if( i == M-1 )
				cnt = X;
		}

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

		printf( "%d\n", cnt?S/cnt:0 );
	}

	return 0;
}

C++: #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <ctime>
#include <iostream>
#include <algorithm>
#include <sstream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <utility>
#include <cctype>
#include <numeric>
using namespace std;

#define rep(i,n) for(int (i)=0; (i)<(int)(n); ++(i))
#define foreach(c,i) for(__typeof((c).begin()) i=(c).begin();i!=(c).end();i++)

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

int solve() {
  if (X[M] == 0) return 0;
  double sum = accumulate(X, X+N, 0);
  sum *= (100 - P);
  return static_cast<int>(sum / X[M]);
}

int main() {
  while (scanf("%d%d%d", &N, &M, &P), N) {
    --M;
    rep(i,N) scanf("%d", X+i);
    printf("%d\n", solve());
  }
  return 0;
}

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

using namespace std;

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

int main()
{
	solve();
	return(0);
}