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;

int main() {
  int N, M, P;
  while (cin >> N >> M >> P, N) {
    auto X = vector<int>(N);
    for (int i = 0; i < N; ++i) cin >> X[i];
    int sum = accumulate(begin(X), end(X), 0);
    cout << ( (X[M - 1] == 0) ? 0 : sum * (100 - P) / X[M - 1] ) << endl;
  }
  return 0;
}

C++: #include <iostream> // C++の入出力
#include <stdio.h> // C の入出力
#include <algorithm> // sort などのアルゴリズム
#include <string.h> // C の文字列用
#include <ctype.h> // C の文字種用
#include <string> // C++の文字列
using namespace std;
int main(void){
    while(1){
        int nin,yu,pars;
        cin>>nin>>yu>>pars;
        if(nin==0&&yu==0&&pars==0)break;
        int data[nin],cnt=0,kin=0;
        for(int i=1;i<=nin;i++){
            cin>>data[i];
            if(i==yu)cnt++;
            kin+=data[i]*100;
        }
        int bun=kin*(100-pars)/100;
        if(data[yu]==0)cout<<"0\n";
        else cout<<bun/data[yu]<<endl;
    }
    return 0;
}

C++: #include<iostream>

using namespace std;

int main(){
  int N,M,X[1000],kazu=0,kane=0,P;
  while(1){
      cin>>N;
      cin>>M;
      cin>>P;
      if(N==0 && M==0 && P==0){
        break;
      }
      for(int lop=0;lop<N;lop++){
          cin>>X[lop];
          kazu+=X[lop];
      }
      if(X[M-1]==0){
        kane=0;
      }else{
        kane=kazu*100;
        kane*=(1.0-(double)P*0.01);
        kane=(double)kane/(double)X[M-1];
      }
      cout<<kane<<endl;
      kane=0;
      kazu=0;
      for(int lop=0;lop<N;lop++){
          X[lop]=0;
      }
  }

  return 0;
}

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 = (1.0 - (double)P / 100.0) * pool;
      std::cout << (int)(for_divide / X[M - 1]) << std::endl;
    }
  }
  return 0;
}

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

int main(){
    while(1){
        int n,m,p,luck; cin>>n>>m>>p;

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

        long long sum=0;

        vector<int> x(n);

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

        sum *= (100-p);
        luck = x[--m];
        int  ans=0;

        if(luck != 0) ans =  sum/luck;

        cout<<floor(ans)<<endl;
    }

    return 0;
}

C++: #include<iostream>

using namespace std;

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

C++: #include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int (i)=(0);(i)<(int)(n);++(i))
using ll = long long;

int main() {

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

        int sum=0, hit=0;
        rep(i, n) { int t; cin >> t; sum += 100*t; if (i == m-1) hit += t; }
        if (hit == 0) cout << 0 << endl;
        else cout << (int)(sum * (100.0 - p) / 100 / hit) << endl;

    }

    return 0;

}

C++: #include <stdio.h>
int main()
{
  int i,n,s,p,moraeruhito,sum,ns;
  while(1){
    scanf("%d %d %d",&n,&s,&p);
    //printf("%d ",n);///
    if(n==0&&s==0&&p==0)break;
    sum=0;
    for(i=1;i<=n;i++){
      scanf("%d",&ns);
      if(i==s)moraeruhito=ns;
      sum+=ns;
    }
    if(moraeruhito==0){
      printf("0\n");
      continue;
    }
    //printf("%d ",sum);///
    sum*=100;
    sum=(double)sum/100*(100-p);
    //printf("%d ",sum);///
    //printf("%d ",moraeruhito);///
    sum/=moraeruhito;
    printf("%d\n",sum);
  }
  return 0;
}

C++: #include <iostream>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>	// require sort next_permutation count __gcd reverse etc.
#include <cstdlib>	// require abs exit atof atoi 
#include <cstdio>		// require scanf printf
#include <functional>
#include <numeric>	// require accumulate
#include <cmath>		// require fabs
#include <climits>
#include <limits>
#include <cfloat>
#include <iomanip>	// require setw
#include <sstream>	// require stringstream 
#include <cstring>	// require memset
#include <cctype>		// require tolower, toupper
#include <fstream>	// require freopen
#include <ctime>		// require srand
#define rep(i,n) for(int i=0;i<(n);i++)
#define ALL(A) A.begin(), A.end()

using namespace std;

typedef long long ll;
typedef pair<int, int> P;

int main()
{
//	cut here before submit 
//	freopen ("testcase.PG", "r", stdin );
	int n, m, p;
	while (scanf ("%d %d %d", &n, &m, &p ) && n && m && p ){
		m--;
		vector<int> x (n, 0 );
//		int sum = 0;
		rep (i, n ){
			scanf ("%d", &x[i] );
		} // end rep
		int sum = accumulate(ALL (x), 0 );		// 売上
		int share = sum*(100-p);	// 配当
		int res = 0;
		if (x[m] != 0 ){
			res = share/x[m];
		} // end if
		printf ("%d\n", res );
	} // end loop

//	printf ("%d\n", res );
		
	return 0;
}

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

using namespace std;

int main(){
	for(int N, M, P; cin >> N >> M >> P, N, M, P; ){
		double bet = 0;
		vector<int> l;
		for(int i = 0; i < N; i++){
			int X; cin >> X;
			l.push_back(X);	
			bet += (X * 100);
		}	
		bet *= (1 - ((double)P / 100));	
		if(l[M - 1]){cout << (int)(bet / l[M - 1]) << endl;}
		else{cout << "0" << endl;}
	}
	return 0;
}

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

using namespace std;

int main() {
  while (true) {
    int N, M, P;
    cin >> N >> M >> P;

    if (N == 0) { break; }

    int atari_count;
    int ticket_count = 0;
    for (int i = 0; i < N; i++) {
      int input;
      cin >> input;
      ticket_count += input;
      if (i+1 == M) { atari_count = input; }
    }

    if (atari_count != 0) {
      printf("%d", 100 * ticket_count * (100 - P) / 100 / atari_count);
    } else {
      printf("0");
    }

    puts("");
  }
  return 0;
}

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

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

    int ave = 0,  deno, x;
    for(int i=0; i<n; i++){
      cin >> x;
      if(i+1 == m)
        deno = x;

      ave += x*100;
    }
    if(deno == 0)
      cout << 0 << endl;
    else{
      ave = ave * (1.0 - p/100.0) / deno;
      cout << ave << endl;
    }
  }
  
  return 0;
}

C++: #include<iostream>  
#include<string>  
#include<cstring>  
#include<algorithm>  
using namespace std;  
  
int main(){  
  
  int n,m,p;  
  int a;  
  int k;  
  int z[1001];  
  int ans;  
  
  while(true){  
    cin >> n >> m >> p;  
    if(!n && !m && !p) break;  
  
    a = 0;  
  
    for(int i=1;i<=n;i++){  
      cin >> k;  
      z[i] = k;  
      a += k;  
    }  
  
    p = 100 - p;  
  
    if(z[m] == 0) ans = 0;  
    else ans = a * p / z[m];  
  
    cout << ans << endl;  
  }  
}