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 <cstdio>
#include <utility>
using namespace std;

#define gcu getchar_unlocked
int in(int c){int n=0;bool m=false;if(c=='-')m=true,c=gcu();
	do{n=10*n+(c-'0'),c=gcu();}while(c>='0');return m?-n:n;}
int in() {return in(gcu());}
bool scan(int &n){int c=gcu();return c==EOF?false:(n=in(c),true);}
bool scan(char &c){c=gcu();gcu();return c!=EOF;}
//bool scan(string &s){int c;s="";
//	for(;;){c=gcu();if(c=='\n'||c==' ')return true;else if(c==EOF)return false;s+=c;}}
#define pcu putchar_unlocked
#define vo inline void out
template <typename T>
vo(T n){static char buf[20];char *p=buf;
	if(n<0)pcu('-'),n*=-1;if(!n)*p++='0';else while(n)*p++=n%10+'0',n/=10;
	while (p!=buf)pcu(*--p);}
vo(const char *s){while(*s)pcu(*s++);}
vo(char c){pcu(c);}
//vo(string &s){for (char c: s) pcu(c);}
template <typename head, typename... tail> vo(head&& h, tail&&... t){out(h);out(move(t)...);}
//template <typename T> vo(vector<T> &v){for(T &x:v)out(&x == &v[0]?"":" "),out(x);out('\n');}
#undef vo

int main() {
	for (int N, M, P; N = in(), M = in(), P = in(), N || M || P;) {
		int s = 0, x = 0, t;
		for (int i = 1; i <= N; i++) {
			s += t = in();
			if (i == M)
				x = t;
		}
		out(x ? s * (100 - P) / x : 0, '\n');
	}
}

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 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++){
      int x;
      cin >>x;
      v.push_back(x);
      NUMP += x;
    }
    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;
    v.clear();
  }
  return 0;
}

C++: 


#include<iostream>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<string>
#include<algorithm>
#include <functional>

using namespace std;

int INF = 10000000;



int x[101];


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

	while(cin >> n >> m >> p && n && m && p)
	{

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

		
		int tmp = 0;
		int sum = 0;

		for(int i = 0;i < n;i++)
		{
			if(m == i+1)tmp = x[i];
			sum += x[i];
		}
				
		int out;
		
		if(tmp)
		out = sum *(100 - p)/tmp;
		else
		out = 0;

		cout << out << endl;
	}

  return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
#define FOR(i, s, n) for(int i = s; i < (int)n; i++)
#define per(i, n) for(int i = n; i >= 0; i--)
#define ROF(i, s, n) for(int i = s; i >= (int)n; i--)
#define FORIT(i, A) for (auto i : A)
#define PRINT(x) cout << (x) << "\n"
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define MP make_pair
#define EACH(i, n) for (__typeof((n).begin()) i = (n).begin(); i != (n).end(); ++i)
#define SZ(a) int((a).size())
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define CLR(a) memset((a), 0 ,sizeof(a))
#define dump(x) cout << #x << " = " << (x) << "\n";
#define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << "\n";
#define sq(n) (n) * (n)
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
typedef vector<LL> VLL;
typedef vector<VLL> VVLL;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef priority_queue<int> maxpq;
typedef priority_queue< int, vector<int>, greater<int> > minpq;
static const double EPS = 1e-10;
static const double PI = acos( -1.0 );
static const int mod = 10007;
static const int INF = 1 << 25;
static const LL LL_INF = 1152921504606846976;
static const int dx[] = { 1, -1, 0, 0,  1, -1,  1, -1 };
static const int dy[] = { 0, 0, 1, -1 , 1,  1, -1, -1 };
static const char Move[] = { 'E', 'W', 'N', 'S' };

int N, M, P, ans;
double Return = 0, percent;
VI X;

int main() {
	while ( ~scanf( "%d %d %d", &N, &M, &P ) && N && M && P ) {
		X.resize( N );
		X.reserve( N );
		for ( int i = 0; i < N; i++ ) {
			scanf( "%d", &X[ i ] );
			Return += X[ i ] * 100;
		}
		if ( X[ M - 1 ] ) {
			Return /= X[ M - 1 ];
		}
		else {
			Return = 0;
		}
		Return -= Return * P / 100;
		ans = Return;
		printf( "%d\n", ans );
	}
	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
#define int long long
#define Rep(i, N) for(int i = 0; i < N; i++)
#define Reps(i, x, N) for(int i = x; i < N; i++)

const int LLINF = 1LL << 60;

signed main()
{
  int N, M, P;
  while(cin >> N >> M >> P, N || M || P) {
    
    int A[105];
    P = 100 - P;

    Rep(i, N) cin >> A[i];
    --M;
    if(A[M]) cout << accumulate(A, A + N, 0LL) * 100 / A[M] * P / 100 << endl;
    else cout << 0 << endl;
  }

  return 0;
}

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

int main(){

    int n,m,p,result,x[100],sum;
    double rate;


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

        sum=0;

        for(int i=0;i<n;i++){
            cin>>x[i];
            sum += x[i] * 100;
        }

       int result = sum *(100-p) / 100;
       if(x[m-1]==0) result = 0;
       else result = result/x[m-1];

        cout<<result<<endl;
    }

    return 0;
}

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

int main(void)
{
        int i ,N, M, P, sum;

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

                sum = 0;
                vector<int> rate(N);
                for(i = 0; i < N; i++){
                        cin >> rate[i];
                        sum += rate[i];
                }
                sum = sum * (100 - P);

                if(rate[M - 1] == 0){
                        cout << "0" << endl;
                }else{
                        cout << sum / rate[M - 1] << endl;
                }
        }
        return 0;
}

C++: #include<iostream>

using namespace std;

int main(){

  int n,m,p,sum,k;

    while(n!=0&&m!=0&&p!=0){
      cin>>n>>m>>p;
      int x[n];
      for(int i=0;i<n;i++){
	cin>>x[i];
      }

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

      sum=100*(x[0]+x[1]+x[2]);

      k=sum-sum*p/100;
      

    
      cout<<k/x[m-1]<<endl;
      }
    
    }


  return 0;
}