Problem:


 Princess' Gamble 

 お姫様のギャンブル 

English text is not available in this practice contest.

ある貧乏な国のおてんばで勇敢なお姫様は，ある日部屋の壁を壊してお城を抜け出し，競馬などのギャンブルが行われている賭博場に入っていった．ところが，ギャンブルなどやったことのないお姫様は，非常に負けが込んでしまった．この状況をおもしろくないと思ったお姫様は，一体どのような仕組みでギャンブルが行われているかを調べてみた．すると，このようなギャンブルではパリミュチュエル方式と呼ばれる方式で配当が決定されていることを突き止めた．

パリミュチュエル方式とは，競走を対象としたギャンブルにおいて配当を決定するために使用する計算方法である．この方式では，全ての掛け金をプールし，一定の割合を控除した上で，当選者に掛け金に比例した金額を分配する．

現在お姫様が熱中しているギャンブルは，参加者は競技前にどの競技者が優勝するかを予想する 1枚100ゴールドの投票券を購入し，競技の結果が予想と一致すれば当選金を受け取る権利を得るというものである．なお，ゴールドはこの国の通貨単位である．あなたの仕事は入力として与えられる競技の情報をもとに，投票券一枚あたりの配当を計算するプログラムを書くことである．

先述の方法で計算される配当額が整数にならない場合は，切り捨てによって整数にすること．

Input

入力は複数のデータセットから成る．データセットの個数は100以下である．最後のデータセットの後に，入力の終わりを示す「0 0 0」からなる一行が与えられる．

各データセットは次のような形式をしている．

N M P

X1

...

XN

最初の行の N は投票の対象となる競技者の数，M は優勝した競技者の番号，P は控除率（百分率）を表す整数である． Xi は i 番目の競技者に投票された投票券の枚数である． 1 ≦ N ≦ 100， 1 ≦ M ≦ N， 0 ≦ P ≦ 100， 0 ≦ Xi ≦ 1000 を仮定してよい．

Output

各データセットに対し，当選した投票券一枚あたりの配当金額を示す整数からなる一行を出力せよ．賭けに勝った人がいない場合は0を出力せよ．出力行には他の文字があってはならない．

Sample Input

3 2 50
1
2
3
4 4 75
1
2
3
0
3 1 10
8
1
1
0 0 0

Output for the Sample Input

150
0
112



Sample input:
3 2 50
1
2
3
4 4 75
1
2
3
0
3 1 10
8
1
1
0 0 0


Sample output:
150
0
112

Submission status: Wrong Answer

Solution code:
while True:
    N, M, P = map(int, input().split())
    if N == 0 and M == 0 and P == 0:
        break
    X = [int(input()) for _ in range(N)]
    win = X[M - 1]
    if win == 0:
        print(0)
    else:
        print(int(sum(X) * 100 // win * (1 - P / 100)))

Submission status: Wrong Answer

Solution code:
while True:
    N, M, P = map(int, input().split())
    if N == 0 and M == 0 and P == 0:
        break
    X = [int(input()) for _ in range(N)]
    win = X[M - 1]
    if win == 0:
        print(0)
    else:
        # print(int(sum(X) * 100 // win * (1 - P / 100)))
        print(int(sum(X) * 100 * (1 - P / 100) // win))

Submission status: Wrong Answer

Solution code:
while True:
    N, M, P = map(int, input().split())
    if N == 0 and M == 0 and P == 0:
        break
    X = [int(input()) for _ in range(N)]
    win = X[M - 1]
    if win == 0:
        print(0)
    else:
        print(int(sum(X) * 100 * (1 - P / 100) // win))

Submission status: Wrong Answer

Solution code:
while True:
    N, M, P = map(int, input().split())
    if N == 0 and M == 0 and P == 0:
        break
    X = [int(input()) for _ in range(N)]
    win = X[M - 1]
    if win == 0:
        print(0)
    else:
        # print("sum: %d" % sum(X))
        # print("P: %d" % P)
        # print("1-P/100: {}".format(1 - P / 10))
        # print(round((1 - P / 100), 100))
        # print("win: %d" % win)
        # print(int(sum(X) * 100 // win * (1 - P / 100)))
        print(int(sum(X) * 100 * round((1 - P / 100), 10) / win))

Submission status: Wrong Answer

Solution code:
def solve(N,M,P,Xs):
	if N < M or Xs[M-1] == 0:
		return 0
	return (sum([x*100 for x in Xs]) * (1-P/100)) // Xs[M-1]
	
def main():
	while True:
		N,M,P = map(int,input().split())
		if N == 0 and M == 0 and P == 0:
			return
		Xs = [int(input()) for _ in range(N)]
		print(int(solve(N,M,P,Xs)))

if __name__ == '__main__':
	main()

Submission status: Wrong Answer

Solution code:
def solve(N,M,P,Xs):
	if Xs[M-1] == 0:
		return 0
	return (sum([x*100 for x in Xs]) * (1-P/100)) / Xs[M-1]
	
def main():
	while True:
		N,M,P = map(int,input().split())
		if N == 0 and M == 0 and P == 0:
			return
		Xs = [int(input()) for _ in range(N)]
		print(int(solve(N,M,P,Xs)))

if __name__ == '__main__':
	main()

Submission status: Wrong Answer

Solution code:
def solve(N,M,P,Xs):
	if Xs[M-1] == 0:
		return 0
	return (sum([x*100 for x in Xs]) * (1.0-P/100)) / Xs[M-1]
	
def main():
	while True:
		N,M,P = map(int,input().split())
		if N == 0 and M == 0 and P == 0:
			return
		Xs = [int(input()) for _ in range(N)]
		print(int(solve(N,M,P,Xs)))

if __name__ == '__main__':
	main()

Submission status: Wrong Answer

Solution code:
def solve(N,M,P,Xs):
	if Xs[M-1] == 0:
		return 0
	total = (sum([x*100 for x in Xs]) * (1-P/100))
	return total / Xs[M-1]
	
def main():
	while True:
		N,M,P = map(int,input().split())
		if N == 0 and M == 0 and P == 0:
			return
		Xs = [int(input()) for _ in range(N)]
		print(int(solve(N,M,P,Xs)))

if __name__ == '__main__':
	main()

Submission status: Wrong Answer

Solution code:
def solve(N,M,P,Xs):
	if Xs[M-1] == 0:
		return 0
	total = sum([x*100 for x in Xs])
	total *= (100-P)/100
	return total / Xs[M-1]
	
def main():
	while True:
		N,M,P = map(int,input().split())
		if N == 0 and M == 0 and P == 0:
			return
		Xs = [int(input()) for _ in range(N)]
		print(int(solve(N,M,P,Xs)))

if __name__ == '__main__':
	main()

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

while True:
    N,M,P = map(int,input().split(" "))
    if N == 0 and M == 0 and P == 0:
        break
    count = 0
    for i in range(N):
        x = int(input())
        count += x
        if i + 1 == M:
            hitman = x
    if hitman == 0:
        print(0)
    else:
        print(int((count*100)*((100-P)/100)//hitman))

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

while True:
    N,M,P = map(int,input().split(" "))
    if N == 0 and M == 0 and P == 0:
        break
    count = 0
    for i in range(N):
        x = int(input())
        count += x
        if i + 1 == M:
            hitman = x
    if hitman == 0:
        print(0)
    else:
        print(int((count*100)*((100-P)/100)/hitman))

Submission status: Wrong Answer

Solution code:
#!/usr/bin/python
# -*- coding: utf-8 -*-
import math

while True:
    amount, number, per = map(int, input().split())
    if amount == 0 and number == 0 and per == 0:
        break

    vote = []
    for i in range(amount):
        vote.append(int(input()))

    if vote[number-1] == 0:
        print("0")
    else:
        print(math.floor((100 * sum(vote) * (per / 100)) / vote[number-1]))

Submission status: Wrong Answer

Solution code:
#!/usr/bin/python
# -*- coding: utf-8 -*-
import math

while True:
    amount, number, per = map(int, input().split())
    if amount == 0 and number == 0 and per == 0:
        break

    vote = []
    for _ in range(amount):
        vote.append(int(input()))

    if vote[number-1] == 0:
        print("0")
    else:
        print(math.floor((100 * sum(vote) * ((100 - per) / 100)) / vote[number-1]))

Submission status: Wrong Answer

Solution code:
#!/usr/bin/python
# -*- coding: utf-8 -*-
import math

while True:
    amount, number, per = map(int, input().split())
    if amount == 0 and number == 0 and per == 0:
        break

    vote = [int(input()) for i in range(amount)]
    # for _ in range(amount):
        # vote.append(int(input()))

    if vote[number-1] == 0:
        print("0")
    else:
        print(math.floor((100 * sum(vote) * ((100 - per) / 100)) / vote[number-1]))

Submission status: Wrong Answer

Solution code:
def solve(n, m, p):
    tot = 0
    a = 0
    for i in range(n):
        x = int(input())
        tot += 100 * x
        if i == m-1: a = x

    if a == 0:
        print(0)
        return

    tot *= (100-p) / 100
    ans = int(tot // a)
    print(ans)


while 1:
    n, m, p = map(int, input().split())
    if n == 0: break
    solve(n, m, p)

Submission status: Wrong Answer

Solution code:
def solve(n, m, p):
    tot = 0
    a = 0
    for i in range(n):
        x = int(input())
        tot += 100 * x
        if i == m-1: a = x

    if a == 0:
        print(0)
        return

    tot *= (100-p) / 100.0
    ans = int(tot / a)
    print(ans)


while 1:
    n, m, p = map(int, input().split())
    if n == 0: break
    solve(n, m, p)

Submission status: Wrong Answer

Solution code:
if __name__ == '__main__':
   while 1:
    n,m,p = list(map(int,input().strip().split()))
    if n ==0 and m ==0 and p ==0:break
    player = []
    for _ in range(n):
        player.append(int(input()))
    bet = sum(player) * 100 *(1.0 - p/100)
    if player[m-1] == 0:print(0)
    else:
        ans = bet/player[m-1]
        print(int(ans))

Submission status: Wrong Answer

Solution code:
while True:
    N,M,P = map(int,input().split())
    if N == 0: break
    src = [int(input()) for i in range(N)]
    print(0 if src[M-1] == 0 else (P * sum(src) // src[M-1]))

Submission status: Wrong Answer

Solution code:
while True:
    N,M,P=map(int,input().split())
    if N==M==P: break
    divSum=0
    for i in range(N):
        temp=int(input())
        divSum+=temp*100
        if i==M-1:
            numWin=temp
    divSum*=(100-P)/100
    if numWin!=0:
        dividents=int(divSum/numWin)
    else: dividents=0
    print(dividents)

Submission status: Wrong Answer

Solution code:
while True:
    N,M,P=map(int,input().split())
    if N==M==P: break
    divSum=0
    for i in range(N):
        temp=int(input())
        divSum+=temp*100
        if i==M-1:
            numWin=temp
    divSum*=(100-P)/100
    if numWin!=0:
        dividents=divSum//numWin
    else: dividents=0
    print(dividents)

Submission status: Wrong Answer

Solution code:
while True:
    N,M,P=map(int,input().split())
    if N==M==P: break
    divSum=0
    for i in range(N):
        temp=int(input())
        divSum+=temp*100
        if i==M-1:
            numWin=temp
    divSum*=(100-P)/100
    if numWin!=0:
        dividents=int(divSum//numWin)
    else: dividents=0
    print(dividents)

Submission status: Wrong Answer

Solution code:
import math
while True:
    N,M,P=map(int,input().split())
    if N==M==P: break
    divSum=0
    for i in range(N):
        temp=int(input())
        divSum+=temp*100
        if i==M-1:
            numWin=temp
    divSum*=(100-P)/100
    if numWin!=0:
        dividents=math.floor(divSum/numWin)
    else: dividents=0
    print(dividents)

Submission status: Wrong Answer

Solution code:
while True:
	n,m,p = map(int, input().split(" "))
	if n+m+p == 0:
		break
	total = 0
	winner = 0
	for i in range(1, n+1):
		x = int(input())
		total += x
		if i == m:
			winner = x
	print(int((1 - p / 100) * 100 * total / winner) if winner > 0 else 0)

Submission status: Wrong Answer

Solution code:
ansli=[]
sum=0

while 1:
    a=input().split()
    if a[0]=="0" and a[1]=="0" and a[2]=="0":
        break
    for i in range(len(a)):
        a[i]=int(a[i])
    x=[]
    for i in range(a[0]):
        x.append(int(input()))

    sum0=0
    for i in x:
        sum0+=i
    sum=sum0*100*((100-a[2])/100)
    hit=x[a[1]-1]
    #print(sum, hit)
    if hit==0:
        ansli.append(0)
    else:
        ansli.append(int(sum/hit))

for i in ansli:
    print(i)

Submission status: Wrong Answer

Solution code:
ansli=[]
sum=0

while 1:
    a=input().split()
    if a[0]=="0" and a[1]=="0" and a[2]=="0":
        break
    for i in range(len(a)):
        a[i]=int(a[i])
    x=[]
    for i in range(a[0]):
        x.append(int(input()))

    sum0=0
    for i in x:
        sum0+=i
    sum=sum0*100*((100-a[2])/100)
    hit=x[a[1]-1]
    if hit==0:
        ansli.append(0)
    else:
        ansli.append(int(sum/hit))

for i in ansli:
    print(i)

Submission status: Wrong Answer

Solution code:
ansli=[]

while 1:
    a=input().split()
    if a[0]=="0" and a[1]=="0" and a[2]=="0":
        break
    for i in range(len(a)):
        a[i]=int(a[i])
    x=[]
    for i in range(a[0]):
        x.append(int(input()))

    sum0=0
    for i in x:
        sum0+=i
    sum=sum0*100*((100-a[2])/100)
    hit=x[a[1]-1]
    if hit==0:
        ansli.append(0)
    else:
        ansli.append(int(sum/hit))

for i in ansli:
    print(i)

Submission status: Wrong Answer

Solution code:
while(True):
    N, M, P = map(int, input().split())
    if N==0 and M==0 and P==0:
        break

    X = []
    for i in range(N):
        X.append(int(input()))

    pool = sum(X) * 100
    if X[M-1] == 0:
        print(0)
        continue

    payout = pool*(1-P/100) / X[M-1]
    ans = int(payout)
    print(ans)

Submission status: Wrong Answer

Solution code:
ans = []
while True:
    n,m,p = map(int,raw_input().split())
    '''n = nmp[0]
    m = nmp[1]
    p = nmp[2]'''
    if n == 0:
        break
    c = 0
    x = [0] * n
    while c != n:
        x[c] = input()
        c += 1
    if x[m-1] == 0:
        ans.append(0)
    else:
        pool = sum(x) * 100
        pool *= (1-p*0.01)
        ans.append(int(pool / x[m-1]))

for i in ans:
    print i

Submission status: Wrong Answer

Solution code:
import sys
import collections


while True:
    N, M, P = map(int, sys.stdin.readline().split())
    if N == 0:
        break
    X = []
    for n in xrange(N):
        X.append(int(sys.stdin.readline()))
    if X[M - 1] == 0:
        print 0
    else:
        print int(sum(X) * (100 - P) / 100 / float(X[M - 1]) * 100)

Submission status: Wrong Answer

Solution code:
while True:
    N,M,P=map(int,raw_input().split())
    if N==M==P==0:break
    L=[0]*1001
    sumVal=0
    for i in range(N):
        x=input()
        L[i]+=x
        sumVal+=x*100
    print int(sumVal*(1-P/100.0)/L[M-1]) if L[M-1]!=0 else 0

Submission status: Wrong Answer

Solution code:
while True:
    N,M,P=map(int,raw_input().split())
    if N==M==P==0:break
    L=[0]*1001
    sumVal=0
    for i in range(N):
        x=input()
        L[i]+=x
        sumVal+=x*100
    print int(sumVal*(1-P/100.0))/L[M-1] if L[M-1]!=0 else 0

Submission status: Wrong Answer

Solution code:
while True:
    N,M,P=map(int,raw_input().split())
    if N==M==P==0:break
    L=[0]*1001
    sumVal=0
    for i in range(1,N+1):
        x=input()
        L[i]+=x
        sumVal+=x*100
    print int(sumVal*(1-P/100.0))/L[M] if L[M]!=0 else 0

Submission status: Accepted

Solution code:
while True:
    n = input().split()
    m = [int(i) for i in n]
    if m[0] == 0:
        break
    l = [int(input()) for k in range(m[0])]
    count = 0
    sumMoney = 0
    for count in range(m[0]):
        sumMoney += l[count]
    money = float(sumMoney * (100 - m[2]))
    try:
        pey = money / l[m[1] - 1]
        print(int(pey))
    except ZeroDivisionError :
        print('0')

Submission status: Accepted

Solution code:
while True:
    N, M, P = map(int, input().split())
    if N == 0 and M == 0 and P == 0:
        break
    X = [int(input()) for _ in range(N)]
    win = X[M - 1]
    if win == 0:
        print(0)
    else:
        print(int(round(sum(X) * 100 * (1 - P / 100) / win, 10)))

Submission status: Accepted

Solution code:
while True:
    (n, m, p) = [int(x) for x in input().split()]
    if n==0 and m==0 and p==0:
        exit()
    X = []
    for i in range(n):
        X.append(int(input()))
    if X[m-1] == 0:
        print(0)
    else:
        print(int(sum(X)*(100-p)/X[m-1]))

Submission status: Accepted

Solution code:
#! /usr/bin/env python
# -*- coding: utf-8 -*-

import os
import sys
import itertools
import math
from collections import Counter, defaultdict

class Main(object):
    
    def __init__(self):
        pass

    def solve(self):
        '''
        insert your code
        '''
        while True:
            n, m, p = map(int, raw_input().split())
            if n == 0 and m == 0 and p == 0:
                break
            a = []
            for i in range(n):
                a.append(input())
            if a[m-1] == 0:
                print 0
            else:
                print 100 * sum(a) * (100 - p) / (100 * a[m-1])
        return None

if __name__ == '__main__':
    m = Main()
    m.solve()

Submission status: Accepted

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

while True:
    N,M,P = map(int,input().split(" "))
    if N == 0 and M == 0 and P == 0:
        break
    count = 0
    for i in range(N):
        x = int(input())
        count += x
        if i + 1 == M:
            hitman = x
    if hitman == 0:
        print(0)
    else:
        print(int((count)*((100-P))/hitman))

Submission status: Accepted

Solution code:
while 1:	
	n, m, p = map(int, raw_input().split(" "))
	if (n,m,p) == (0,0,0):
		break
	x = [0]
	x[1:] = [int(raw_input()) for i in range(n)]
	if x[m] == 0:
		print 0
	else :
		print sum(x) * (100 - p) / x[m]

Submission status: Accepted

Solution code:
#! /usr/bin/python
# -*- coding: utf-8 -*-

(N, M, P) = map(int, raw_input().split())
while not(N==0 and M==0 and P==0):
    x = []
    for i in range(N):
        x.append(int(raw_input()))
    if x[M-1] == 0:
        print 0
    else:
        print int(sum(x)*(100-P)/x[M-1])
    (N, M, P) = map(int, raw_input().split())

Submission status: Accepted

Solution code:
while(1):
    [n,m,d]=[int(x) for x in raw_input().split()]
    if n==0:
        break
    else:
        total=0
        winner=0
        for i in range(1,n+1):
            buy=int(raw_input())
            total=total+buy*100
            if i==m:
                winner=buy
    prize=total*(100-d)/100.
    if winner==0:
        print 0
    else:
        print int(prize/winner)

Submission status: Accepted

Solution code:
from math import floor

while True:
    n,m,p = map(int, input().split())
    if n == 0 :  break
    x = []
    for i in range(n):
        x.append(int(input()))
    pool = sum(x) * (100 - p)
    div = floor(pool / x[m - 1]) if x[m - 1] != 0 else 0
    print(div)

Submission status: Accepted

Solution code:
#!/usr/bin/python
# -*- coding: utf-8 -*-
import math

while True:
    amount, number, per = map(int, input().split())
    if amount == 0 and number == 0 and per == 0:
        break

    vote = [int(input()) for _ in range(amount)]

    if vote[number-1] == 0:
        print("0")
    else:
        print(math.floor(100 * sum(vote) * (100 - per) / 100 / vote[number-1]))

Submission status: Accepted

Solution code:

while True:
	n, m, p = map(int, input().split())
	if (n, m, p) == (0, 0, 0):
		break
	x = [int(input()) for i in range(n)]
	if x[m-1] == 0:
		print(0)
	else:
		print(int(sum(x) * (100-p) / x[m-1]))

Submission status: Accepted

Solution code:
while(1):
  aaa=map(int,raw_input().split(" "))
  if aaa[0]==0 and aaa[1]== 0 and aaa[2]==0:
    break
  cnt=0
  sum=0
  for i in range(aaa[0]):
    tmp=input()
    if i+1==aaa[1]:
      cnt=tmp
    sum+=tmp
  if cnt!=0:
    print int((100.0*sum*(100-aaa[2])/100)/cnt)
  else:
    print 0

Submission status: Accepted

Solution code:
while True:
    n, m, p = map(int, raw_input().split())
    if n == 0:
        break
    x = [int(raw_input()) for _ in range(n)]

    if x[m - 1] == 0:
        print 0
    else:
        print sum(x)*(100 - p) / x[m - 1]

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import array
import math


def solve(m, p, xs):
    total_prize = sum(xs) * (100 - p)
    number_of_winners = xs[m - 1]
    if not number_of_winners:
        return 0
    else:
        return math.floor(total_prize / number_of_winners)


if __name__ == "__main__":
    while True:
        n, m, p = map(int, input().split())
        if n == 0 and m == 0 and p == 0:
            break
        xs = array.array("H", (int(input()) for i in range(n)))
        print(solve(m, p, xs))

Submission status: Accepted

Solution code:
def solve(n, m, p):
    tot = 0
    a = 0
    for i in range(n):
        x = int(input())
        tot += 100 * x
        if i == m-1: a = x

    if a == 0:
        print(0)
        return

    tot = tot * (100-p) / 100.0
    ans = int(tot / a)
    print(ans)


while 1:
    n, m, p = map(int, input().split())
    if n == 0: break
    solve(n, m, p)

Submission status: Accepted

Solution code:
while True:
  N,M,P = map(int, raw_input().split())
  if N==M==P==0: break
  tip = 0
  winner = 0
  for i in xrange(N):
    c = int(raw_input())
    tip += c
    if i == M-1:
      winner = c
  if winner == 0:
    print "0"
  else:
    print tip * 100 * (100-P) / 100 / winner

Submission status: Accepted

Solution code:
while True:
    n,m,p = map(int,input().split())
    if m==n==p==0: break
    l = [int(input()) for _ in range(n)]
    r = int(sum(l)*(100-p)/l[m-1]) if l[m-1]!=0 else 0
    print(r)

Submission status: Accepted

Solution code:
while 1:
    n,m,p=map(int,input().split())
    if n==0:break
    x=[int(input()) for _ in range(n)]
    print(sum(x)*(100-p)//x[m-1] if x[m-1] else 0)

Submission status: Accepted

Solution code:
while 1:
    N,M,P = map(int,raw_input().split())
    if N == 0 and M == 0 and P == 0:
        break
    total = 0
    for i in range(N):
        x = int(input())
        total += x*100
        if i+1 == M:
            y = x
    if y == 0:
        print 0
    else:
        print total*(100-P)/100/y

Submission status: Accepted

Solution code:
if __name__ == '__main__':
   while 1:
    n,m,p = list(map(int,input().strip().split()))
    if n ==0 and m ==0 and p ==0:break
    player = []
    for _ in range(n):player.append(int(input()))
    bet = sum(player) *(100 - p)
    if player[m-1] == 0:print(0)
    else:
        ans = bet/player[m-1]
        print(int(ans))

Submission status: Accepted

Solution code:
while True:
    n, m, p = map(int, input().split())
    if n == 0:
        break
    players = [int(input()) for _ in range(n)]
    gold_div = sum(players) * (100 - p)
    winner = players[m - 1]
    print(int(gold_div / winner) if winner > 0 else 0)

Submission status: Accepted

Solution code:
while True:
    n,m,p = map(int, input().split())
    if n==0:
        break
    players =[int(input()) for _ in range(n)]
    winTickets = players[m-1]
    retGld = sum(players) * (100-p)
    print(int(retGld / winTickets) if winTickets > 0 else 0)

Submission status: Accepted

Solution code:
while True:
    N,M,P = map(int,input().split())
    if N == 0: break
    src = [int(input()) for i in range(N)]
    if src[M-1] == 0:
        print(0)
    else:
        print((100-P) * sum(src) // src[M-1])

Submission status: Accepted

Solution code:
import math
while True:
    N,M,P=map(int,input().split())
    if N==M==P: break
    divSum=0
    for i in range(N):
        temp=int(input())
        divSum+=temp*100
        if i==M-1:
            numWin=temp
    divSum=int(divSum*(100-P)/100)
    if numWin!=0:
        dividents=math.floor(divSum/numWin)
    else: dividents=0
    print(dividents)

Submission status: Accepted

Solution code:
while True:
    N, M, P = map(int, raw_input().split())

    if N == 0 and M == 0 and P == 0:
        break

    X = [int(raw_input()) for _ in range(N)]

    print 0 if X[M-1] == 0 else sum(X) * (100-P) / X[M-1]

Submission status: Accepted

Solution code:
import math
while True:
	n,m,p = map(int, input().split(" "))
	if n+m+p == 0:
		break
	total = 0
	winner = 0
	for i in range(1, n+1):
		x = int(input())
		total += x
		if i == m:
			winner = x
	print(math.floor(100 * total * (100 - p) / 100 / winner) if winner > 0 else 0)

Submission status: Accepted

Solution code:
while True:
    n, m, p = map(int, input().split())
    if n == 0 and m == 0 and p == 0:
        break

    x = [int(input()) for i in range(n)]
    total = sum(x) * (100 - p)
    if x[m - 1] == 0:
        print(0)
    else:
        print(total // x[m - 1])

Submission status: Accepted

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**3
eps = 1.0 / 10**10
mod = 10**9+7

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)


def main():
    rr = []
    while True:
        n,m,p = LI()
        if n == 0:
            break
        a = [I() for _ in range(n)]
        s = sum(a) * 100 * (100-p) // 100
        if a[m-1] == 0:
            rr.append(0)
        else:
            rr.append(s // a[m-1])

    return '\n'.join(map(str, rr))


print(main())

Submission status: Accepted

Solution code:
while 1:
  N,M,P=map(int,input().split())
  if not N and not M and not P:break
  X=[int(input()) for _ in range(N)]
  if not X[M-1]:r=0
  else:r=int(sum(X)*100*(100-P)/100/X[M-1])
  print(r)

Submission status: Accepted

Solution code:
result_all = []
counter = 0
while True:
    N,M,P = map(int, input().split())
    if(N == 0 and M == 0 and P == 0): break
    X = [int(input()) for i in range(N)]
    X_sum = sum(X)
    if(X[M-1] == 0):
        result_all.append(0)
        continue
    result = ((X_sum * 100) - ((X_sum * 100) * (P / 100))) / X[M-1]
    result_all.append(result)

for i in range(len(result_all)):
    print(int(result_all[i]))

Submission status: Accepted

Solution code:
result_all = []
counter = 0
while True:
    N,M,P = map(int, input().split())
    if(N == 0 and M == 0 and P == 0): break
    X = [int(input()) for i in range(N)]
    X_sum = sum(X)
    if(X[M-1] == 0):
        result_all.append(0)
        continue
    result = ((X_sum * 100) - ((X_sum * 100) * (P / 100))) / X[M-1]
    result_all.append(result)

for i in range(len(result_all)):
    print(int(result_all[i]))

Submission status: Accepted

Solution code:
ansli=[]

while 1:
    a=input().split()
    if a[0]=="0" and a[1]=="0" and a[2]=="0":
        break
    for i in range(len(a)):
        a[i]=int(a[i])
    x=[]
    for i in range(a[0]):
        x.append(int(input()))

    sum0=0
    for i in x:
        sum0+=i
    sum=sum0*(100-a[2])
    hit=x[a[1]-1]
    if hit==0:
        ansli.append(0)
    else:
        ansli.append(int(sum/hit))

for i in ansli:
    print(i)

Submission status: Accepted

Solution code:

def main():
    while True:
        N,M,P=map(int, raw_input().split(" "))
        if N|M|P == 0: break
        solve(N,M,P)

def solve(N,M,P):
    x=[]
    s=0
    N2=N
    while N2>0:
        x.append( int( raw_input() ) )
        s+=x[-1]*100
        N2-=1
    s-=(s/100)*P
    M-=1
    print s/x[M] if x[M]>0 else 0

if __name__=="__main__": main()

Submission status: Accepted

Solution code:
import sys
import collections


while True:
    N, M, P = map(int, sys.stdin.readline().split())
    if N == 0:
        break
    X = []
    for n in xrange(N):
        X.append(int(sys.stdin.readline()))
    if X[M - 1] == 0:
        print 0
    else:
        print int(float(sum(X)) * 100 * (100 - P) / 100 / X[M - 1])

Submission status: Accepted

Solution code:
while True:
	n, m, p = map(int, raw_input().split())
	if n == m == p == 0: break
	gambler = 0;
	for i in xrange(n):
		x = input()
		gambler += x;
		if i + 1 == m:
			hit = x
	if hit:
		pool = gambler * 100 - gambler * p
		print pool / hit
	else:
		print 0

Submission status: Accepted

Solution code:
while True:
    N,M,P=map(int,raw_input().split())
    if N==M==P==0:break
    s,b=0,-1
    for i in range(1,N+1):
        x=input()
        s+=x
        if i==M:
            b=x
    print int(s*100*(100-P)/(100.0*b)) if b!=0 else 0

Submission status: Accepted

Solution code:
while 1:
    n, m, p = map(int, raw_input().split())
    if not n:
        break
    x = [0] * n
    sum = 0
    for i in range(n):
        x[i] = input()
        sum += x[i]
    if not x[m - 1]:
        print 0
    else:
        print sum * (100 - p) / x[m - 1]

Submission status: Accepted

Solution code:
while 1:
    n, winner, rate = map(int, raw_input().split())
    if not (n|winner|rate): break
    ls = [input() for x in range(n)]
    if not ls[winner-1]: print 0
    else: print int(sum(ls) * (100-rate) * 1.0/ls[winner-1])

Submission status: Accepted

Solution code:
while 1:
	n,m,p=map(int,raw_input().split())
	if n==0:break
	x=[input() for i in range(n)]
	if x[m-1]==0:
		print 0
		continue
	print int((100-p)*sum(x)/float(x[m-1]))

Submission status: Accepted

Solution code:
while 1:
	n,m,p=map(int,raw_input().split())
	if n==0:break
	x=[input() for i in range(n)]
	print (100-p)*sum(x)/x[m-1] if x[m-1]!=0 else 0

Submission status: Accepted

Solution code:
while 1:
	n,m,p=map(int,raw_input().split())
	if n==0:break
	x=[int(raw_input()) for i in range(n)]
	print (100-p)*sum(x)/x[m-1] if x[m-1]!=0 else 0

Submission status: Accepted

Solution code:
while True:
    N, M, P = map(int, input().split())
    if N == 0 and M == 0 and P == 0:
        break
    X = [0 for i in range(N)]
    for i in range(N):
        X[i] = int(input())
    
    if X[M - 1] != 0:
        print(sum(X) * (100 - P) // X[M - 1])
    else:
        print(0)

Submission status: Accepted

Solution code:
l = input()
while l != '0 0 0':
    l_split = l.split(' ')
    athletes = int(l_split[0])
    winner = int(l_split[1])
    percent = int(l_split[2])
    total_ticket = 0
    win_ticket = 0
    for i in range(athletes):
        tickets = int(input())
        total_ticket += tickets
        if i + 1 == winner and tickets > 0:
            win_ticket = tickets
    if win_ticket > 0:
        total_money = total_ticket*(100 - percent)
        print(str(total_money//win_ticket))
    else:
        print('0')
    l = input()

Submission status: Accepted

Solution code:
import math

while True:
    data = input().split()
    n, m ,p = int(data[0]),int(data[1]),int(data[2])
    if n == 0 and m == 0 and p == 0: break

    x = []
    pool = 0
    for i in range(n):
        bets = int(input())
        pool += bets * 100 
        x.append(bets)
    winner = m-1
    if x[winner] == 0:
        print(0)
    else:
        eps = 0.000000001
        ans = math.floor(pool*(1-p/100) + eps)
        ans = math.floor(ans / x[winner] + eps)
        print(ans)

Submission status: Accepted

Solution code:
while True :
    N, M, P = map(int, input().split())
    if N == 0 and M == 0 and P == 0 :
        break
    
    Sum = 0
    for i in range(N) :
        x = int(input())
        Sum += x
        if i == M - 1 :
            winner = x
    if winner == 0 :
        print(0)
    else :
        print(int(Sum * 100 * (100 - P) / 100 / winner))

Submission status: Accepted

Solution code:
while 1:
    n,m,p = map(int,input().split())
    if n == 0 and m == 0 and p == 0:
        break
    x = [int(input()) for i in range(n)]
    Sum_kingaku = sum(x)*100
    p = p / 100
    koujyo = Sum_kingaku * p
    kakekin = Sum_kingaku - koujyo
    if x[m-1] == 0:
        ans = 0
    else:
        ans = kakekin // x[m-1]
    print(int(ans))

Submission status: Accepted

Solution code:
import math
TICKET_PRICE = 100


def get_data_list():
    data_list = input().split()
    for i in range(len(data_list)):
        data_list[i] = int(data_list[i])
    return data_list

def get_input():
    input_data = int(input())
    return input_data

def make_ticket_dict(player):
    ticket_sum = 0
    ticket_list = dict()
    order = 1
    for i in range(player):
        input_data = get_input()
        ticket_list[order] = input_data
        order += 1
    return ticket_list

def calculate_distribution_money(ticket_list, deduction_rate):
    ticket_sum = 0
    for ticket_num in ticket_list.values():
        ticket_sum += ticket_num
    sum_money = ticket_sum * TICKET_PRICE
    distribution_money = sum_money * (100 - deduction_rate) / 100
    return distribution_money


if __name__ == "__main__":
    while True:
        data_list = get_data_list()
        if data_list[0] == 0:
            break
        player = data_list[0]
        winner = data_list[1]
        deduction_rate = data_list[2]
        ticket_list = make_ticket_dict(player)
        if ticket_list[winner] == 0:
            print(0)
            continue
        distribution_money = calculate_distribution_money(ticket_list, deduction_rate)
        each_distribution_money = math.floor(distribution_money / ticket_list[winner])
        print(each_distribution_money)

Submission status: Accepted

Solution code:
import math
while True:
    n,m,p = map(int,input().split())
    if n == m == p == 0:
        break
    m -= 1
    x = [int(input()) for i in range(n)]
    if x[m] == 0:
        print(0)
    else:
        print(math.floor((100-p)*sum(x)/x[m]))