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<cstdio>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<cmath>
#include<cstring>
#include<utility>
#include<set>
#include<stack>
#include<complex>
#define vi vector<int>
#define vvi vector<vector<int> >
#define ll long long int
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vb vector<bool>
#define vc vector<char>
#define vs vector<string>
#define ld long double
#define INF 1e9
#define EPS 0.0000000001
#define rep(i,n) for(int i=0;i<n;i++)
#define CC puts("-------ok--------");
#define all(in) in.begin(), in.end()
#define bv vector<bool>
using namespace std;
typedef pair<int, int>PA;
using namespace std;
#define MAX  999999
int main(){
    while(true){
    int n,m; double p; cin >> n >> m >> p;
        if(n+m+p == 0)break;
    vi v(2000,0); int sum = 0;
    rep(i,n){
        int temp;cin >> temp;
        v[i+1]=temp;sum+=temp*100;
    }
    double money = (double)(sum-sum*(p/100));
    if(v[m]) cout << (int)money/v[m] << endl;
    else
        cout << 0 << endl;
    }
}

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 );
		percent = ( 100 - P ) * 0.01;
		for ( int i = 0; i < N; i++ ) {
			scanf( "%d", &X[ i ] );
			Return += X[ i ];
		}
		Return *= percent;
		if ( X[ M - 1 ] ) {
			Return /= X[ M - 1 ];
		}
		else {
			Return = 0;
		}
		ans = Return * 100;
		printf( "%d\n", ans );
	}
	return 0;
}

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

int main(){
  int n,m,p;
  while(cin>>n>>m>>p){
    if(n==0)break;
    double G=0;
    int num[n];
    for(int i=0;i<n;i++){
      cin>>num[i];
      G+=num[i];
    }
    G*=(100.0-p);
    if(num[m-1]!=0){
      cout << (int)(G/num[m-1]) << endl;
    }else{
      cout << 0 << endl;
    }
  }
  return 0;
}

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

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

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

int main(){
	int N,M,winner;
	double P,sum;
	bool flag;
	while(cin>>N>>M>>P,N && M && P){
	    flag=false;
	    sum=0;
	    winner=0;
		for(int i=1;i<=N;i++){
			int temp;
			cin>>temp;
			if(M==i){
				winner=temp;
				flag=true;
			}
			sum=sum+temp;
		}
		
		sum=sum*100;
		sum=sum*(1-(P/100));
		if(flag && winner!=0){
			sum=sum/(double)winner;
			printf("%d\n",(int)sum);
		}
		else{
			printf("0\n");
		}
	}
}

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)( 1. * rest / xs[ m - 1 ] ) << endl;
		}
	}

	return 0;
}

C++: #include <iostream>

using namespace std;

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

    return 0;
}

C++: #include <iostream>

using namespace std;

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

    return 0;
}