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 <cstdio>
#include <vector>
#include <cmath>
#include <cstring>
#include <numeric>
#include <algorithm>
#include <functional>
#include <array>
#include <map>
#include <queue>
using namespace std;

#define Getsign(n) ((n > 0) - (n < 0))

typedef vector<int> Ivec;
typedef pair<int, int> Pos;

int main() {
	int n,m,p;
	
	while (scanf("%d %d %d", &n, &m, &p)) {
		if (!n)
			return 0;

		int hitter = 0, sum = 0;
		for (int i = 0; n > i; i++) {
			int a;
			scanf("%d", &a);
			if (i + 1 == m) hitter = a;
			sum += 100 * a;
		}
		if (!hitter)printf("0\n");
		else printf("%d\n", (int)(sum/100*(100-p) / hitter));
	}




	return 0;
}

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

#define INF_LL (int64)1e18
#define INF (int32)1e9
#define REP(i, n) for(int i = 0;i < (n);i++)
#define FOR(i, a, b) for(int i = (a);i < (b);i++)
#define all(x) x.begin(),x.end()
#define fs first
#define sc second

using int32 = int_fast32_t;
using uint32 = uint_fast32_t;
using int64 = int_fast64_t;
using uint64 = uint_fast64_t;
using PII = pair<int32, int32>;
using PLL = pair<int64, int64>;

const double eps = 1e-6;

template<typename A, typename B>inline void chmin(A &a, B b){if(a > b) a = b;}
template<typename A, typename B>inline void chmax(A &a, B b){if(a < b) a = b;}

const int64 mod = 1e9+7;

int main(void){
	int32 n, m, p;
	while(cin >> n >> m >> p && n && m && p){
		vector<int64> x(n);
		int64 sum = 0;
		REP(i, n){
			cin >> x[i];
			sum += x[i];
		}
		if(x[m-1] != 0)
			sum = (sum*100-sum*p)/x[m-1];
		else sum = 0;
		cout << sum << endl;
	}
}

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;
    }
    int money = sum*(1-(p)/(double)100);
    if(v[m]) cout << money/v[m] << endl;
    else
        cout << 0 << endl;
    }
}

C++: #include<bits/stdc++.h>
using namespace std;
const long long INF = 1e7+1;
const long long MOD = 1000000007;
const long double PI = 3.1415926;
#define FOR(i,r,n) for(ll i = (ll)(r); i < (ll)(n); i++)
#define RFOR(i,r,n) for(ll i=(ll)(n-1);i>=r;i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define ALL(x) x.begin(),x.end()
#define RALL(x) x.rbegin(),x.rend()
typedef long long int ll;
typedef vector<ll> vi;
typedef vector < pair<ll, ll > > vp;
typedef vector <string> vs;
typedef vector <char> vc;
typedef list <ll> lst;

ll n,m, k, ans = 0, sum = 0, cnt = 0;
string s;
char c;

/*--------------------template--------------------*/

int main()
{
	ll n, m, p;
	while (1) {
		cin >> n >> m >> p;
		if (n == 0 && m == 0 && p == 0) {
			return 0;
		} else {
			vi v(n);
			ans = 0;
			sum = 0;
			REP(i, n)
			{
				cin >> v[i];
			}
			sum = accumulate(ALL(v), 0LL);
			sum = sum * 100 * (100 - p) / 100;
			if (v[m - 1] == 0) {
				cout << 0 << endl;
			} else {
				ans = sum / v[m - 1];
				cout << ans << endl;
			}
		}
	}
}

C++: #include <iostream>

using namespace std;

int main()
{
    int n, m, p;
    int num[101];
    while (cin >> n >> m >> p, n|m|p) {
        int total = 0;
        for (int i = 1; i <= n; i++) {
            cin >> num[i];
            total += num[i] * (100-p);
        }
        if (!num[n]) {
            cout << 0 << endl;
            continue;
        }
        cout << (total / num[m]) << endl;
    }
    return 0;
}

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

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

    while (cin >> n >> m >> p, (n || m || p)) {
        vector<int> x(n);
        int sum = 0;
        for (auto &i : x) cin >> i, sum += i;

        sum *= (100 - p);

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

    return 0;
}

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

int main()
{
  int N,M,X,i;
  double P,S;
  while(cin>>N>>M>>P,N||M||P){
    S=0.0;
    for(i=0;i<N;i++){
      cin>>X;
      S+=100.0*X;
      if(i==M-1)M=X;
    }
    S*=(100.0-P)/100.0;
    if(M)cout<<(int)S/M<<endl;
    else cout<<"0"<<endl;
  }
}

C++: #include<iostream>
using namespace std;
int main() {
	int n;
	int m;
	int p;
	int answer;
	int x[1000];
	int *q ;
	while (1) {
		cin >> n;
		cin >> m;
		cin >> p;
		
		if (n == 0 && m == p && p == 0) {
			break;
		}

		for (int i = 0; i < n; i++) {
			cin >> x[i];
			if (x[i] == 0) {
				break;
			}
		}
		q = &x[m];
		answer = *q* p;
		cout << answer;
	}
}

C++: #include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <utility>
#include <cstring>
#include <iomanip>
#include <numeric>
#include <cmath>
#include <cassert>
#include <complex>
#define repi(i,x,n) for(int i = x; i < n; i++)
#define rep(i,n) repi(i,0,n)
#define int long long
using namespace std;
const int INF = 1<<30;
const int MOD = 1e9 + 7;
const double EPS = 1e-8;
signed main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n,m,p;
    int a[100],sum=0;
    while(1){
        sum=0;
        rep(i,100) a[i]=0;
        cin>>n>>m>>p;
        if(m==0 && n==0 && p==0) break;
        rep(i,n){
            cin>>a[i];
            sum+=a[i];
        }
        sum*=(100-p);
        if(a[m-1]==0) cout<<0<<endl;
        else cout<<sum/a[m-1]<<endl;
        
    }
    return 0;
}

C++: # include <iostream>
# include <algorithm>
# include <vector>
# include <string>
# include <set>
# include <map>
# include <cmath>
# include <iomanip>
# include <functional>
# include <utility>
# include <stack>
# include <queue>
# include <list>
using namespace std;
using LL = long long;
constexpr long long MOD = 1000000000 + 7;
constexpr long long INF = 1000000000;
const double PI = acos(-1);

int main() {
	int n, m, p;
	while (cin >> n >> m >> p&&n) {
		int x[1001] = {};
		int sum = 0;
		int t;
		for (int i = 1; i <= n; i++) {
			cin >> x[i];
			sum += x[i];
			if (i == m)t = x[i];
		}
		if (t == 0) {
			cout << 0 << endl;
		}
		else {
			cout << sum * (100 - p) / t << endl;
		}
	}
}

C++: #include<iostream>

using namespace std;

int main(){

  int n,m,p,sum,k;

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

    if(n==0&&m==0&&p==0){
      break;
    }

      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;
}