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 <algorithm>
#include <iostream>
#include <vector>
#include <string>
#include <cmath>
using namespace std;

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

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
	int n,m,p;
	while(cin>>n>>m>>p,n){
	int cnt=0;
	int t;
	for(int i=0;i<n;i++){
		int x;
		cin>>x;
		cnt+=x;
		if(i+1==m)t=x;
	}
	if(t==0)cout<<t<<endl;
	else cout<<cnt*(100-p)/t<<endl;
}
	return 0;
}

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 v[101];
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++){
      cin >>v[i];
      NUMP += v[i];
    }
    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;
  }
  return 0;
}

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

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

C++: #include <iostream>
#include <fstream>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <stack>

#define rep(i,x) for(int i=0;i<x;i++)
#define rrep(i,x) for(int i=x-1;i>=0;i--)
#define rep_to(a,i,x) for(int i=a;i<x;i++)

using namespace std;

int main()
{
	int N,M,P;
	while(cin >> N >> M >> P && N)
	{
		int x[100000]={};
		int sum=0;

		rep(i,N)
		{
			cin >> x[i];
			sum+=x[i]*100;
		}

		if(x[M-1]!=0)cout<<sum/x[M-1]*(100-P)/100<<endl;
		else cout<<0<<endl;
	}
}

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

int main(int argc, char const* argv[])
{
  while (true) {
    int N, M, P;
    std::cin >> N >> M >> P;
    if (N == 0 && M == 0 && P == 0)
      break;
    std::vector<int> X(N);
    double pool = 0.0;
    for (int i = 0; i < N; ++i) {
      std::cin >> X[i];
      pool += X[i] * 100;
    }
    if (X[M - 1] == 0) {
      std::cout << 0 << std::endl;
    } else {
      double for_divide = pool - ((double)P / 100.0) * pool;
      std::cout << (int)(for_divide / X[M - 1]) << std::endl;
    }
  }
  return 0;
}

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

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

while (true) {
  cin >> n >> m >> p;
if (n==0 && m == 0 && p == 0) break;
 vector< int > x(n);
  double sm = 0;
  for (int i=0; i<n; ++i) {
    cin >> x[i];
    sm += x[i];
  }

  //# 3 2 50
  //# 1 2 3
  
  sm *= 100.0;
int ans;
  if (x[m-1] == 0) {ans = 0;}
  else ans = (sm * (double)(100 - p) / 100.0) / (double)x[m-1];
  cout << ans << 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;
VI X;

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

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

int main(){
  int N,M,P;

  while(true){
    cin >> N >> M >> P;
    if(!N && !M && !P) break;
    int hit=0,nm[100],sum = 0;
    for(int i = 0 ; i < N ; i++){
      cin >> nm[i];
      sum += nm[i];
      if(nm[i] == M) hit++;
    }
    if(!hit){
      cout << '0' << endl;
      continue;
    }
    int money = sum*(100-P)/nm[M-1];
    cout << money << endl;
  }

  return 0;
}

C++: #include<iostream>
#include<string.h>
#include<string>
#include<cstdio>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<cmath>
#include<utility>
#include<set>
#define ll long long int
#define ld long double
#define INF 1000000000
#define EPS 0.0000000001
#define rep(i,n) for(i=0;i<n;i++)
using namespace std;
typedef pair<int, int> pii;

int main()
{
  int n,m,p,x;
  int num[105]={};
  int i;

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

}

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

	}
	return 0;
}

C++: #include<iostream>
using namespace std;
int main() {
	int n, m, p;
	while (cin >> n >> m >> p, n || m || p) {
		int sum = 0;
		int key;
		for (int i = 1; i <= n; i++) {
			int k; cin >> k;
			sum += k;
			if (i == m)key = k;
		}
		if (key == 0)cout << "0\n";
		else cout << sum  * (100 - p)  / key << endl;
	}
}

C++: #include <iostream>

using namespace std;

int main(){

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

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

				sum *= (100-p);

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