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] ;
    }
    pool *= (100-p);
//     debug(pool);
    if(x[m-1] != 0){
      cout << (int)(pool / x[m-1])<<endl;
    }
    else{
      cout << 0 << endl;
    }
  }
  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;

	total=total*(100-p)/100;

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

}

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

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

    cin >> n >> m >> p; 
  }
}

C++: #include<iostream>
using namespace std;
int main()
{
	int n, m, p;
	int x[101];
	while (cin >> n >> m >> p && n != 0 && m != 0 && p != 0)
	{
		int sum = 0;
		for (int i = 1; i <= n; i++)
		{
			cin >> x[i];
			sum += x[i];
		}
		if (x[m] == 0)
		{
			cout << 0 << endl;
			continue;
		}
		sum *= 100;
		sum -=((double)p /100.0) * sum;
		int ans = (int)(sum / x[m]);
		cout <<  ans << endl;

	}
	return 0;
}

C++: #include<iostream>
#include<map>
#include<algorithm>
#include <iomanip>
#include <cmath>
#include <sstream>
#include <unordered_map>
#include <unordered_set>
#include <deque>
#include <vector>
#include <bitset>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <cstring>
#include <cstdio>
#include <list>


constexpr int INF = 1050000000;
constexpr int MOD = 1000000007;
constexpr long long LONGINF = 1005000000000000000;
using namespace std;

using ll = long long;

class UnionFind {
private:
	std::vector<int> parent;
	std::vector<int> height;
	std::vector<int> m_size;

public:
	UnionFind(int size_) : parent(size_), height(size_, 0), m_size(size_, 1) {
		for (int i = 0; i < size_; ++i) parent[i] = i;
	}
	void init(int size_) {
		parent.resize(size_);
		height.resize(size_, 0);
		m_size.resize(size_, 1);
		for (int i = 0; i < size_; ++i) parent[i] = i;
	}
	int find(int x) {
		if (parent[x] == x) return x;
		return parent[x] = find(parent[x]);
	}
	void unite(int x, int y) {
		x = find(x);
		y = find(y);
		if (x == y) return;
		int t = size(x) + size(y);
		m_size[x] = m_size[y] = t;
		if (height[x] < height[y]) parent[x] = y;
		else parent[y] = x;
		if (height[x] == height[y]) ++height[x];
	}
	bool same(int x, int y) {
		return find(x) == find(y);
	}
	int size(int x) {
		if (parent[x] == x) return m_size[x];
		return size(parent[x] = find(parent[x]));
	}
};


int main() {

	int n, m, p;
	
	while (1) {
		cin >> n >> m >> p;
		if (n == 0 && m == 0 && p == 0) { return 0; }

		int sum = 0;

		int x[1005];

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

		if (x[m] == 0) { cout << 0 << endl; }
		else {
			cout << (sum * (100 - p) / 100) / x[m] << endl;
		}
	}

}

C++: #include <stdio.h>

int main(){

  int m,n,p,i,sum=0,ans=0;
  int x[100]={};
  for(;;){
    
    scanf("%d %d %d",&n,&m,&p);

    if(n==0&&m==0&&p==0){
      break;
    }
    for(i=1;i<=n;i++){
      scanf("%d",&x[i]);
      sum+=x[i];
    }

    if(x[m]!=0){
      ans=(100*sum/x[m])*((100-p)*0.01);
    }

    if(x[m]==0){
      printf("0\n");
    }
    else{
      printf("%d\n",ans);
    }
      ans=0;
      sum=0;
      for(i=1;i<=n;i++){
	x[i]=0;
      }
    }  
    return 0;
  }

C++: #include <iostream>
using namespace std;
int n,m,p,sum,ans;
int x[101];
int main(){
	while(1){
		cin >> n>>m >>p;
		if(n==0&&m==0&&p==0)break;
		sum=0;
		for(int i=1;i<=n;i++){
			cin >>x[i];
			sum+=x[i];
		}
		if(x[m]==0){
			ans=0;
		}else{
			ans=sum*(100-p)/x[m];
		}
		cout <<ans <<endl;
	}
	return 0;
}

C++: //#include <bits/stdc++.h>
#include <iostream>
#include <string>
#include <cmath>
#include <vector>
#include <cstring>
#include <climits>
#include <queue>
#include <algorithm>
#include <utility>
#define INF INT_MAX / 2
using namespace std;

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

int main(void) {
	int N,M,P;
	while(cin >> N >> M >> P,N+M+P!=0){
		int x,wm = 0,all = 0;
		for(int i=1;i<=N;i++){
			cin >> x;
			if(i==M){
				wm = x;
			}
			all += x;
		}

		if(wm == 0){
			cout << 0 << endl;
		}else{
			int sub = 0;
			all *= 100;
			sub = (all*P)/100;
			wm = (all-sub)/wm;
			cout << wm << endl;
		}
	}
}

// command shift d duplicate
// command ctrl 上下
// command D
// command caps G → '' ""
// vector<vector<int>> a(N,vector<int>(M,-1));

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

using namespace std;

int main(){
	int n, m, p;
	while(cin >> n >> m >> p, n || m || p){
		vector<int> x(n);
		int bet = 0;
		
		for(int i = 0; i < n; i++){//input
			cin >> x[i];
			bet += x[i];
		}

		bet = bet * (100 - p);
		if(x[m-1] == 0){
			cout << 0 << endl;
		}else{
			double tmp = bet/x[m-1];
			cout << (int)tmp << endl;
		}
	}

	return 0;
}