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 <string>
#include <algorithm>
#include <queue>
#include <map>
#include <set>
#include <vector>
#include <cmath>
#include <cctype>
#include <cstdlib>
#define rep(i,a,b) for(int i=(a);i<b;i++)
#define INF 1000000000
using namespace std;
bool debug=false;

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

  while(1){
    cin>>n>>m>>p;
    if(n==0&&m==0&&p==0)break;

    int sum=0,point;

    for(int i=1;i<=n;i++){
      int x;
      cin>>x;
      sum+=x;
      if(i==m)point=x;
    }
    int per=(100-p);
    sum=sum*per;
    if(debug)cout<<"sum:"<<sum<<" "<<"point:"<<point<<"   "<<"per:"<<per<<endl;
    if(point==0)cout<<0<<endl;
    else cout<<sum/point<<endl;
  }

  return 0;  
}

C++: #include<iostream>
#include<map>
#include<vector>
#include<list>
#include<algorithm>
#include<cmath>
#include<iomanip>
#include<numeric>
#include<climits>
#include<ctime>
#include<cstring>
#define REP(i,p,n) for(int i=p;i<(int)(n);i++)
#define rep(i,n) REP(i,0,n)
#define rep_split(tok,a_str,re) for(char *tok = strtok((char *)a_str.c_str(),re); tok != NULL; tok = strtok(NULL,re))
#define all(c) (c).begin(), (c).end()

using namespace std;

int main() {
	int N,M,P;
	double X[120];
	long long sum,ans;
	double zyun_money_per;

	while(cin >> N >> M >> P) {
		if (N==0 && M==0 && P==0) { break; }
		sum=0;
		REP(i,1,N+1) {
			cin >> X[i];
			sum+=X[i];
		}
		if (X[M] == 0) {
			cout << "0" << endl;
		}
		else {
			zyun_money_per = (100-P)*0.01;
			ans = (sum/X[M])* 100 * zyun_money_per;//切り捨て
			cout << ans << endl;
		}
	}

	return 0;
}

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 h = 0;
    
    rep(i, n){
      cin >> x[i];
      h += x[i];
    }
    
    int ans = 0;
    rep(i, n){
      if(x[i] == 0){
	ans = 0;
	break;
      }else if(i == m){
	ans = h*(100-p)/x[i];
      }
    }
    cout << ans << '\n';
  }
}

C++: #include <iostream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
#include <set>

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,j) FOR(i,0,j)
#define mp std::make_pair

const int INF = 1 << 24;
const int dx[8] = {0, 0, 1, -1, 1, 1, -1, -1}, dy[8] = {1, -1, 0, 0, 1, -1, 1, -1};

typedef unsigned long long ull;
typedef std::pair<int,int> P;

int main(){
    int N, M, P;
    while(std::cin >> N >> M >> P, N){
        int cn = 0;
        int X[101];

        FOR(i, 1, N+1){
            std::cin >> X[i];
            cn += X[i];
        }

        if(X[M] == 0){puts("0");}
        else{
            printf("%d\n", cn * (100 - P) / X[M]);
        }
    }
}

C++: #include <iostream>
using namespace std;
int main(){
  int n,m,p;
  int num[100];
  while(cin >> n >> m >> p && n&&m&&p){
    int sum = 0;
    for(int i=0; i<n; i++){
      cin >> num[i];
      sum+=num[i];
    }
    sum *= (100-p);
    if(!num[m-1])
      cout << '0' << endl;

    else
      cout << sum/num[m-1] << endl;
  }
}

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<iostream>
#include<vector>
#include<algorithm>

using namespace std;

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

	long long n, m, p;
	long long j = 0;
	vector<long long>ans(10000000);

	while(1){
		cin >> n >> m >> p;
		if (n == 0 && m == 0 && p == 0)
			break;
		long long sum = 0;

		vector<long long>x(n,0);
		for (int i = 0;i < n;i++) {
			cin >> x[i];
			sum += x[i];
		}

		if (x[m - 1] != 0) {
			ans[j] = (sum * 100 / x[m - 1])*(100-p)/100;
		}
		else {
			ans[j] = 0;
		}
		j++;

	} 

	for (long long i = 0;i < j;i++) {
		cout << ans[i] << endl;
	}
	return 0;
}

C++: #include <vector>
#include <list>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <deque>
#include <algorithm>
#include <utility>
#include <functional>
#include <sstream>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <climits>
#include <cassert>
#include <memory>
#include <time.h>
using namespace std;
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef pair<int, int> pii;
typedef long long ll;
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
const double EPS = 1e-9;
const double PI  = acos(-1.0);


int main(){
	int n,m,p;
	while(cin>>n>>m>>p,n|m|p){
		vi x(n);
		int total=0;
		REP(i,n){
			cin>>x[i];
			total+=x[i]*100;
		}
		total=total*(100-p)/100;
		if(x[m-1]==0){
			cout<<0<<endl;
		}else{
			cout<<(int)((double)total/x[m-1])<<endl;
		}
	}
}

C++: #include <stdio.h>

int main(){

  int m,n,p,i,sum=0,ans=0;
  int x[100]={};
  for(;;){
    
    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]);
      sum+=x[i];
    }

    if(x[m]!=0){
      ans=((double)100*sum/x[m])*((100-p)*0.01);
    }

    if(x[m]==0){
      printf("0\n");
    }
    else{
      printf("%d\n",ans);
    }
      ans=0;
      sum=0;
      for(i=1;i<=n;i++){
	x[i]=0;
      }
    }  
    return 0;
  }

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

#define fi first
#define se second
#define repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define repr(i,n) for(int i=(int)(n-1);i>=0;i--)
#define rep(i,n) repl(i,0,n)
#define each(itr,v) for(auto itr:v)
#define pb(s) push_back(s)
#define all(x) (x).begin(),(x).end()
#define dbg(x) cout << #x" = " << x << endl
#define print(x) cout << x << endl
#define maxch(x,y) x=max(x,y)
#define minch(x,y) x=min(x,y)
#define uni(x) x.erase(unique(all(x)),x.end())
#define exist(x,y) (find(all(x),y)!=x.end())
#define bcnt(x) bitset<32>(x).count()

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> P;
typedef pair<P, int> PPI;
typedef pair<int, P> PIP;
typedef pair<ll, ll> PL;
typedef pair<P, ll> PPL;
typedef set<int> S;

#define INF INT_MAX/3
#define MAX_N 1000000001


int main(){
  cin.sync_with_stdio(false);
  int n, m, p;
  while(cin >> n >> m >> p, n) {
    int sum = 0, mm = 0;
    rep(i, n) {
      int x;
      cin >> x;
      sum += x;
      if (i == m - 1) mm = x;
    }

    if (mm) mm = (sum * (100 - p)) / mm;
    cout << mm << endl;
  }

  return 0;
}