Skip to content

Instantly share code, notes, and snippets.

@lp6m
Created November 16, 2014 08:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lp6m/37bd3475684eafb8fe0e to your computer and use it in GitHub Desktop.
Save lp6m/37bd3475684eafb8fe0e to your computer and use it in GitHub Desktop.
#include <iostream>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <cmath>
#include <string>
#include <sstream>
#include <iomanip>
#include <complex>
using namespace std;
#define ll long long
#define vvi vector< vector<int> >
#define All(X) X.begin(),X.end()
#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define pb push_back
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}
int n,m,p;
int main(){
while(1){
cin >> n >> m >> p;
if(n==0&&m==0&&p==0) break;
int sum = 0;
int waru;
REP(i,n){
int tmp;
cin >> tmp;
if(i==m-1) waru = tmp;
sum += tmp;
}
if(waru==0) cout << 0 << endl;
else cout << sum*100*(100-p)/100/waru << endl;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment