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<vector>

using namespace std;

int ans[100];
int cont = 0;

int main()
{
	for(;;){
		int n;		//[ÌÎÛÆÈé£ZÒÌ
		int m;		//Dµ½£ZÒÌÔ
		double p;		//T¦
		int temp;
		
		int total = 0;	//S[Ìvàz
		
		cin >> n;
		cin >> m;
		cin >> p;
		
		if(n == 0 && m == 0 && p == 0){
			break;
		}
		
		vector<int> ken(n,0);
		
		for(int i = 0; i < n; i++){
			cin >> ken[i];
		}
		
		/*  vàz±o  */
		for(int i = 0; i < n; i++){
			total += ken[i]*100;
		}
		
		total = total*((100-p)/100);
		
		if(ken[m-1] == 0){
			total = 0;
		}
		else{
			total = total / ken[m-1];
		}
		
	//	cout << total << endl;
		ans[cont] = total;
		
		cont++;
	}
	
	for(int i = 0; i < cont; i++){
		cout << ans[i] << endl;
	}
	
}

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

if(c==100)cout<<0;
else cout<<((int)sum*(100-c))/e;
}
cout<<endl;
}
return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <vector>
#include <cstdio>
#include <string>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cmath>
#include <functional>
#include <numeric>
#include <iomanip>
#define fi first
#define se second
#define fcout(n) cout<<fixed<<setprecision((n))
#define cinl(str) getline(cin,(str))
using namespace std;
bool value(int y,int x,int R,int C){return 0<=y&&y<R&&0<=x&&x<C;}
typedef pair<int,int> pii;
typedef long long ll;
typedef vector<int> vi;
typedef vector<long long > vll;
typedef vector< vi > vvi;
double pie=acos(-1);
int INF=1000000007;
int dx[4] = { 0,-1,0,1 };
int dy[4] = { -1,0,1,0 };


int main() {
	int n,m,p;
	int x[105];
	long long ans=0;
	while(true){
		cin>>n>>m>>p;
		if(n+m+p==0) return 0;
		ans=0;
		//cout<<ans<<" "<<n<<" "<<m<<" "<<" "<<p<<endl;
		for(int i=0;i<n;i++){
			cin>>x[i];
			ans+=x[i]*100;
		}
		for(int i=0;i<n;i++){
			if(i+1==m){
				if(x[i]!=0){
					ans=ans/100;
					ans=ans*(100-p);
					ans=ans/x[i];
					break;
				}
				else{
					ans=0;
					break;
				}
			}
		}
		cout<<ans<<endl;


	}
}

C++: #include <iostream>
#include <complex>
#include <sstream>
#include <string>
#include <algorithm>
#include <deque>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <vector>
#include <set>
#include <limits>
#include <cstdio>
#include <cctype>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <ctime>
using namespace std;
#define REP(i, j) for(int i = 0; i < (int)(j); ++i)
#define FOR(i, j, k) for(int i = (int)(j); i < (int)(k); ++i)
#define SORT(v) sort((v).begin(), (v).end())
#define REVERSE(v) reverse((v).begin(), (v).end())
typedef complex<double> P;

int main() {
  int N, M, P;
  while(cin >>N >>M >>P && N){
    int sum = 0, h = 0;
    REP(i, N){
      int tmp; cin >>tmp;
      sum += (tmp * 100);
      if(i + 1 == M) h = tmp;
    }
    P = 100 - P;
    sum = sum * P / 100;
    cout <<(h == 0 ? 0 : sum / h) <<endl;
  }
  return 0;
}

C++: #include <stdio.h>

int main(void){
	double sum;
	int n, m, p, i, x[100];
	while(1){
		scanf("%d%d%d",&n,&m,&p);
		if(n == 0 && m == 0 && p == 0)
			break;
		sum = 0;
		for(i = 0;i < n;i++){
			scanf("%d",&x[i]);
			sum += 100 * x[i];
		}
		if(x[m - 1] == 0){
			sum = sum * (100 - p) * 0.01;
			sum /= x[m - 1];
			printf("%d\n",(int)sum);
		}
		else
			printf("0\n");
	}
	return 0;
}

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

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

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

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&&b==0&&c==0)break;
	if(b==0)cout<<0;
	else{
for(i=0;i<a;i++){
cin>>d;
sum+=d;
if(i==b-1)e=d;
}

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,p;

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

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

	total=total*100;
	
	double per;

	per=(100.0-p)/100.0;

	total=total*per;

	
	if(x[m]==0)
	  cout<<0<<endl;
	else
	  cout<<total/x[m]<<endl;
	
  }

}

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<int32> x(n);
		int32 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 <vector>
#include <algorithm>
using namespace std;
int main(){
    int a[1001];
    int n,m,p;
    while(cin>>n>>m>>p&&!(n==0&&m==0&&p==0)){
        int sum=0;
        m--;
        for(int i = 0; i < n; i++){
            cin>>a[i];
            sum+=a[i];
        }
        sum=sum*(100-p);
        if(a[m]==0)
            cout<<0<<endl;
        else{
            cout<<sum/a[m]<<endl;
        }
    }

    return 0;
}