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;
using ll = long long;
using ld = long double;
using P = pair<int, int>;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
const double eps = 1e-10;
const int MOD = 1000000007;
const int INF = 1000000000;
const ll LINF = 1ll<<50;
template<typename T>
void printv(const vector<T>& s) {
  for(int i=0;i<(int)(s.size());++i) {
    cout << s[i];
    if(i == (int)(s.size())-1) cout << endl;
    else cout << " ";
  }
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(10);
  while(1) {
    int n, m, p; cin >> n >> m >> p;
    if(n == 0) break;
    m--;
    vi a(n);
    int su = 0;
    for(int i=0;i<n;++i) {
      cin >> a[i];
      su += a[i];
    }
    su *= (100 - p);
    if(a[m] == 0) cout << 0 << endl;
    else cout << su / a[m] << endl;
  }
}

C++: #include<iostream>
#include<vector>
#include<list>
#include<string>
#include<algorithm>
#include<map>
#include<cmath>
using namespace std;
int main() {
	int n, m, p;
	while (cin >> n >> m >> p&&n + m + p != 0) {
		int sum = 0;
		int t = 0, x;
		for (int i = 0; i < n; i++) {
			cin >> x;
			sum += (x*100);
			if (i == m - 1) t = x;
		}
		if (t != 0) {
			cout << floor(sum*((100.0 - p) / 100) / t) << endl;
		}
		else cout << 0 << endl;
	}
}

C++: #include<iostream>

using namespace std;

int main(){
	int n,m,p;
	while(cin>>n>>m>>p ||n||m||p){
		int sum=0;
		int suc=0;
		for(int i=1;i<=n;i++){
			int x;
			cin>>x;
			if(i==m)suc=x;
			sum+=x;
		}
		sum*=(100-p);
		if(suc!=0)cout<<sum/suc<<endl;
		else cout<<0<<endl;
	}
}

C++: #define _USE_MATH_DEFINES
#include <algorithm>
#include <cstdio>
#include <functional>
#include <iostream>
#include <cfloat>
#include <climits>
#include <cstring>
#include <cmath>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <time.h>
#include <vector>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> i_i;
typedef pair<ll, int> ll_i;
typedef pair<double, int> d_i;
typedef pair<ll, ll> ll_ll;
typedef pair<double, double> d_d;
struct edge { int u, v; ll w; };

ll MOD = 1000000007;
ll _MOD = 1000000009;
double EPS = 1e-10;

int main() {
	for (;;) {
		int N, M, P; cin >> N >> M >> P;
		if (N == 0) break;
		vector<int> X(N);
		for (int i = 0; i < N; i++) cin >> X[i];
		int sum = 0;
		for (int i = 0; i < N; i++) sum += X[i];
		sum *= 100 - P;
		cout << (X[M - 1] ? sum / X[M - 1] : 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>
#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 total = 0;
	
	for(int i = 0;i < n; i++){
	  cin >> x[i];
	  total += x[i];
	}
	
	total = total * (100 - p);
	if(x[m-1] == 0){
	  cout << 0 << endl;
	}else{
	  double tmp = total/x[m-1];
	  cout << (int)tmp << endl;
	}
  }

  return 0;
}

C++: #include <iostream>
#include <fstream>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <stack>

#define rep(i,x) for(int i=0;i<x;i++)
#define rrep(i,x) for(int i=x-1;i>=0;i--)
#define rep_to(a,i,x) for(int i=a;i<x;i++)

using namespace std;

int main()
{
	int N,M,P;
	while(cin >> N >> M >> P && N)
	{
		int x[100000]={};
		double sum=0;

		rep(i,N)
		{
			cin >> x[i];
			sum+=x[i]*100;
		}

		if(x[M-1]!=0)cout<<floor(sum/x[M-1]*(100-P)/100)<<endl;
		else cout<<0<<endl;
	}
}

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

int main(){
	int n,m,p,i,array[100],a,price;
	double pd,priced,tmpp;
	while(cin >> n >> m >> p && (n != 0 || m != 0 || p != 0)){
		memset(array,0,sizeof(array));
		price = 0;
		tmpp = (double)p;
		pd = (double)(1.0 - (tmpp / 100));
		for(i = 0;i < n;i++){
			cin >> a;
			array[i] = a;
			price += a * 100;
		}
		priced = (double)(price * pd);
		if(array[m-1] != 0){
			cout << (int)(priced / array[m-1]) << endl;
		}
		else {
			cout << 0 << endl;
		}
	}
	return 0;
}

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;
		double ans  =sum - ((double)p /100.0) * sum;
		cout << (int)(ans / x[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> vec(n,0);
    for(int i = 0;i < n;i++){
      cin >> vec[i];
    }
    int sum = 0;
    for(int i = 0;i < n;i++){
      sum += vec[i];
    }
    sum = sum*(100 - p);
    //cout << sum << endl;
    if(vec[m-1] == 0)cout << 0 << endl;
    else cout << (int)(sum / vec[m-1]) << endl;
  }
  return 0;
}

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

using namespace std;

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) FOR(i,0,(n))
#define MAX_N 105

int N,M,P;
int x[MAX_N];

bool input(){
  REP(i,MAX_N)x[i]=0;
  cin>>N>>M>>P;

  REP(i,N)cin>>x[i];

  return (N!=0);
}

void solve(){
  int total=0;
  REP(i,N)total+=x[i];
  total*=(100-P);
  if(x[M-1]==0)cout<<0<<endl;
  else {
    int ans=total/x[M-1];
  cout<<ans<<endl;
  }
}
int main(){
  while(input())solve();
  return 0;
}