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++: // clang-format off
#include <bits/stdc++.h>
#define int long long
#define main signed main()
// #define main int main()
#define loop(i, a, n) for (int i = (a); i < (n); i++)
#define rep(i, n) loop(i, 0, n)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define prec(n) fixed << setprecision(n)
#define stlice(from, to) substr(from, (to) - (from) + 1)
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
using namespace std;
using pii = pair<int, int>;
using vi = vector<int>;
using vd = vector<double>;
using vc = vector<char>;
using vb = vector<bool>;
using vs = vector<string>;
using vpii = vector<pii>;
using vvi = vector<vi>;
using vvb = vector<vb>;
using vvpii = vector<vpii>;
template<typename A> using fn = function<A>;
constexpr int INF = sizeof(int) == sizeof(long long) ? 1000000000000000000LL : 1000000000;
constexpr int MOD = 1000000007;
constexpr double PI = acos(-1);
template<typename A, typename B> bool cmin(A &a, const B &b) { return a > b ? (a = b, true) : false; }
template<typename A, typename B> bool cmax(A &a, const B &b) { return a < b ? (a = b, true) : false; }
constexpr bool odd(const int &n) { return n & 1; }
constexpr bool even(const int &n) { return !odd(n); }
template<typename V> constexpr typename V::value_type sum(const V &v) { return accumulate(all(v), 0); }
void solve();
main { solve(); return 0; }
// clang-format on

void solve() {
  int n, m, p;
  while (cin >> n >> m >> p, n) {
    m--;
    int s = 0;
    int x[n];
    rep(i, n) {
      cin >> x[i];
      s += x[i];
    }
    s *= (100 - p);
    cout << (x[m] ? s / x[m] : 0) << endl;
  }
}

C++: // Author :
// Date :
// Problem:
// Solution:
// Comment:

#include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <cmath>
#include <cstring>

#define pp push
#define pb push_back
#define mp make_pair
#define xx first
#define yy second

using namespace std;

void play(int n,int m,int p){
    int mas[105];
    int sum=0;
    
    for(int i = 1 ; i <= n ; i++){
        cin >> mas[i];
        sum+= mas[i];
    }
    
    sum*=100;
    
    sum = sum - (sum/100)*p;
    
    cout << int(double(sum)/double(mas[m])) << endl;
}
main(){
    int n,m,p;
    
    while(cin >> n >> m >> p){
        if(n == 0) break;
        play(n,m,p);
    }
    #ifdef GEREL
        for(;;);
    #endif

    return 0;
}

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

int main(void){
  while(true){
    int n, m, p;
    cin >> n >> m >> p;
    if(n == 0 && m == 0 && p == 0){ break; }
    
    int sum = 0;
    vector<int> x(n);
    for(int i = 0; i < n; i++){
      cin >> x[i];
      sum += x[i];
    }

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

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

int main(){
	long int n,m,p,i,array[100],a,price;
	long 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.0) + 1e-8);
		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, x[101];
  
  while(cin >> n >> m >> p && n && m && p){
    int sum=0;
    for(int i=1; i<=n; i++){
      cin >> x[i];
      sum+=x[i];
    }
    if(x[m]==0){
      cout << 0 << endl;
    } else {
      cout << sum * (100-p) / x[m] << endl;
    }
  }

C++: 


#include<iostream>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<string>
#include<algorithm>
#include <functional>

using namespace std;

int INF = 10000000;



int x[101];


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

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

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

		
		int tmp;
		int sum = 0;

		for(int i = 0;i < n;i++)
		{
			if(m == i+1)tmp = x[i];
			sum += x[i];
		}

		
		int out;
		
		if(tmp)
		out = sum *(100 - p)/tmp;
		else
		out = 0;

		cout << out << endl;
	}

  return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <string>
#include <sstream>
#include <algorithm>
#include <math.h>
#include <map>
#include <iomanip>
#include <vector>
#include <queue>

#define PI 3.14159265359

#define INF 1000000;

#define rep(i,n) for(int i=0;i<n;i++)
#define REP(n) rep(i,n)

using namespace std;


/*
class ElectronicPetEasy
{
public:
	string isDifficult(int st1, int p1, int t1, int st2, int p2, int t2)
	{
		
	}
};
*/


int main()
{
	int N, M, P, a[101] = {0}, s = 0;
	
	while (cin >> N >> M >> P, N)
	{
		s = 0;
		for (int i=1; i<=N; i++)
		{
			cin >> a[i];
			s += a[i];
		}
		if (a[M])
		{
			cout << s*(100-P)/a[M] << endl;
		} else {
			cout << 0 << endl;
		}
	}
	
	return 0;
}

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

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

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;
VI X;

int main() {
	while ( ~scanf( "%d %d %d", &N, &M, &P ) && N && M && P ) {
		X.resize( N );
		for ( int i = 0; i < N; i++ ) {
			scanf( "%d", &X[ i ] );
			Return += X[ i ];
		}
		if ( X[ M - 1 ] ) {
			Return /= X[ M - 1 ];
		}
		else {
			Return = 0;
		}
		Return -= P * 0.01 * Return;
		ans = Return * 100;
		Return = 0;
		printf( "%d\n", ans );
	}
	return 0;
}

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