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 <bits/stdc++.h>
using namespace std ;

#define pb(n) push_back(n)
#define fi first
#define se second
#define all(r) (r).begin(),(r).end()
#define gsort(st,en) sort((st),(en),greater<int>())
#define vmax(ary) *max_element(all(ary))
#define vmin(ary) *min_element(all(ary))
#define debug(x) cout<<#x<<": "<<x<<endl
#define fcout(n) cout<<fixed<<setprecision((n))
#define scout(n) cout<<setw(n)
#define vary(type,name,size,init) vector< type> name(size,init)
#define vvl(v,w,h,init) vector<vector<ll>> v(w,vector<ll>(h,init));

#define rep(i,n) for(int i = 0; i < (int)(n);++i)
#define REP(i,a,b) for(int i = (a);i < (int)(b);++i)
#define repi(it,array) for(auto it = array.begin(),end = array.end(); it != end;++it)
#define repa(n,array) for(auto &n :(array))

using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using dict = map<string,int>;
using pii = pair<int,int> ;
using pll = pair<ll,ll> ;

const int mod = 1000000007;
constexpr int imax = ((1<<30)-1)*2+1 ;
constexpr int inf = 100000000;
constexpr double PI = acos(-1.0) ;
double eps = 1e-10 ;
const int dy[] = {-1,0,1,0,1,-1,1,-1};
const int dx[] = {0,-1,0,1,1,-1,-1,1};

inline bool value(int x,int y,int w,int h){
  return (x >= 0 && x < w && y >= 0 && y < h);
}

template<typename T>
void Unique(vector<T> &v){
  sort(all(v));
  v.erase(unique(all(v)),v.end());
}

template<typename T>
T ston(string& str, T n){
  istringstream sin(str) ;
  T num ;
  sin >> num ;
  return num ;
}

void Ans(bool f){
  if(f) cout << "YES"<<endl;
  else cout << "NO"<<endl;
}

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll n,m ,p;
  while(cin >> n >> m >> p && n && m && p){
    vary(double,x,n,0);
    double pool = 0;
    rep(i,n){
      cin >> x[i];
      pool += x[i] * 100;
    }
    pool *= (100-p) / 100.0;
//     debug(pool);
    if(x[m-1] != 0){
      cout << (int)(pool / x[m-1])<<endl;
    }
    else{
      cout << 0 << endl;
    }
  }
  return 0;
}

C++: #include <iostream>
#include <iomanip>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <cfloat>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <functional>
#include <utility>
#include <numeric>
#include <iterator>

using namespace std;

typedef long long LL;
typedef unsigned long long ULL;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int,int> PII;
typedef istringstream ISS;
typedef ostringstream OSS;

#define REP( i, m, n ) for ( int i = (int)( m ); i < (int)( n ); ++i )
#define FOR( v, c ) for ( auto &v : c )

#define EACH( it, c ) for ( auto it = c.begin(); it != c.end(); ++it )
#define ALL( c ) (c).begin(), (c).end()
#define DRANGE( c, p ) (c).begin(), (c).begin() + p, (c).end()

#define PB( n ) push_back( n )
#define MP( a, b ) make_pair( ( a ), ( b ) )
#define EXIST( c, e ) ( (c).find( e ) != (c).end() )

#define fst first
#define snd second

#define DUMP( x ) cerr << #x << " = " << ( x ) << endl
#define DEBUG( x ) cerr << __FILE__ << ":" << __LINE__ << ": " << #x << " = " << ( x ) << endl

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

	while ( true )
	{
		int n, m, p;
		cin >> n >> m >> p;

		if ( !( n | m | p ) )
		{
			break;
		}

		VI xs( n );
		FOR( x, xs )
		{
			cin >> x;
		}

		int total = accumulate( ALL( xs ), 0 ) * 100;
		double rest = total * ( 1. - p / 100. );

		if ( xs[ m - 1 ] == 0 )
		{
			cout << 0 << endl;
		}
		else
		{
			cout << (int)( rest / xs[ m - 1 ] ) << endl;
		}
	}

	return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
	int a,b,c,i,d,e,sum;
	while(1){
		sum=0;
	cin>>a>>b>>c;
	if(a==0&&a==b&&c==0)break;
for(i=0;i<a;i++){
cin>>d;
sum+=d;
if(i==b-1)e=d;
}
if(e==0)cout<<e;
if(c==100)cout<<0;
else if(c==0)cout<<sum*100/e;
else cout<<(sum*100-sum*c)/e;
cout<<'\n';
}
return 0;
}

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

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

C++: #include <bits/stdc++.h>

#define rep(i, n) for (int i = 0; i < (int)n; ++i)
#define REP(i, a, b) for (int i = (int)a; i < (int)b; ++i)
#define rer(i, a, b) for (int i = (int)a; i <= (int)b; ++i)
#define each(i,c) for(__typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define all(v) v.begin(), v.end()
#define mset(a, n) memset(a, n, sizeof(a))

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<vector<int> > vvi;
typedef vector<pair<int, int> > vpii;
typedef pair<int, int> pii;
typedef pair<long long, long long> pll;

const int inf = 1000000000;
const int mod = 1000000007;
const double eps = 1e-9;
const int dx[] = { -1, 0, 1, 0};
const int dy[] = { 0, -1, 0, 1};

int main() {
	int N, M, P;
	while (cin >> N >> M >> P, (N || M || P)) {
		int num, sum = 0;
		REP(i, 1, N + 1) {
			int x; cin >> x;
			sum += x;
			if (i == M) num = x;
		}

		sum *= (100 - P);
		if (num) {
			int ans = sum / num;
			cout << ans << endl;
		} else {
			cout << num << endl;
		}
	}
	return 0;
}

C++: #include<iostream>
#include<vector>
#include<numeric>
using namespace std;
int main() {
	int n, m;double p;
	while (cin >> n >> m >> p&&n&&m) {
		//p /= 100;
		vector<int> x;
		int cnt = 0,y;
		for (int i = 0; i < n; i++) {
			cin >> y;
			x.push_back(y);
		}
		double money = 100*accumulate(x.begin(), x.end(), 0);
		money = money*(100 - p);
		if (x[m-1]==0)cout << 0 << endl;
		else cout << (int)(money / (double)x[m-1]/100.0) << endl;
	}
	return 0;
}

C++: #include<iostream>
#include<vector>
#include<map>
#define P pair<int,int>
using namespace std;
int main(){
int n,m,p;
while(cin>>n>>m>>p,n||m||p){
	int maisu=0,tmp,atari;
	int  ans=0;
	for(int i=0;i<n;i++){
		cin>>tmp;
		maisu+=tmp*100;
		if(i+1==m)atari=tmp;
	}
		//cout<<"p"<<p;
	if(atari==0)ans=0;

	else {
		ans=maisu;
		ans-=maisu*p/100;
		ans=ans/atari;
	}
	cout<<ans<<endl;
}
return 0;
}

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

int main(){
  int i,n,m,p,x[1001],total;


  while(1){
    for( i = 1; i <=1000; i++){
      x[i]=0;
    }
      
    total = 0;
    cin >> n >> m >> p;
    if(n==0 && m==0 && p==0)break;
    for( i = 1; i <= n; i++){
      cin >> x[i];
      total += x[i];

    }
      
    total*=100;

      
    if(x[m]!=0){
      total /= x[m];

      total = total * (100- p) /100;
      cout << total << endl;
    }else{
      cout << 0 << endl;
    }
  }
  return 0;
}