Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
 
ans = 0
 
for i in range(N):
    ans = ans + 1 / A[i]
 
ans = 1 / ans 
 
print(ans)

Fixed submission:
a = int(input())
s = input()

if a >= 3200:
    print(s)
else:
    print("red")

Buggy python submission (verdict: Runtime Error):
N = int(input())

A = [int(input()) for _ in range(N)]
Ans = 0

for i in range(N):
    v += 1 / a[i]
print(1 / Ans)

Fixed submission:
a = int(input())
s = input()

if a >= 3200:
    print(s)
else:
    print("red")
Buggy python submission (verdict: Runtime Error):
N = int(input())

A = [int(input()) for b in range(N)]
Ans = 0

for i in range(N):
    v += 1 / a[i]
print(1 / Ans)


Fixed submission:
N = int(input())
A = list(map(int, input().split()))
 
ans = 0
 
for i in range(N):
    ans = ans + 1 / A[i]
 
ans = 1 / ans 
 
print(ans)

Buggy python submission (verdict: Runtime Error):
N = int(input())

A = [int(input()) for _ in range(N)]
Ans = 0

for i in range(N):
    v += 1 / a[i]
print(1 / Ans)


Fixed submission:
N = int(input())
A = list(map(int, input().split()))
 
ans = 0
 
for i in range(N):
    ans = ans + 1 / A[i]
 
ans = 1 / ans 
 
print(ans)

Buggy python submission (verdict: Runtime Error):
N = int(input())

A = list(map(int, input().split()))
Ans = 0

for i in range(N):
    v += 1 / a[i]
print(1 / Ans)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
 
ans = 0
 
for i in range(N):
    ans = ans + 1 / A[i]
 
ans = 1 / ans 
 
print(ans)
Buggy python submission (verdict: Runtime Error):
a,b,c,d,e,k= map(int, input().split())

A-B = b-a
A-C = c-a
A-D = d-a
A-E = e-a
B-C = c-b
B-D = d-b
B-E = e-b
C-D = d-c
C-E = e-c
D-E = e-d

if (A-B > k) or (A-C > k) or (A-D > k) or (A-E > k) or (B-C > k) or (B-E > k) or (C-D > k) or (C-E > k) or (D-E > k):
    print(":(")
else:
    print("Yay!")

Fixed submission:
A, B = map(int, input().split())
 
C = A+B
D = A-B
E = A*B
 
LIST = [C,D,E]
 
print(max(LIST))

Buggy python submission (verdict: Runtime Error):
A, B = map(int, input().split())

C = print(A+B)
D = print(A-B)
E = print(A*B)

LIST = [C,D,E]

print(max(LIST))

Fixed submission:
A, B = map(int, input().split())
 
C = A+B
D = A-B
E = A*B
 
LIST = [C,D,E]
 
print(max(LIST))

Buggy python submission (verdict: Runtime Error):
A, B = map(int, input().split())

C = print(A+B)
D = print(A-B)
E = print(A*B)

print(max(C,D,E))


Fixed submission:
A, B = map(int, input().split())
 
C = A+B
D = A-B
E = A*B
 
LIST = [C,D,E]
 
print(max(LIST))

Buggy python submission (verdict: Runtime Error):
import numpy
A, B = map(int, input().split())

C = print(A+B)
D = print(A-B)
E = print(A*B)

if C > D and C > E:
    print(C) 
elif D > C and D > E:
    print(D)
elif E > C and E > D:
    print(E)

Fixed submission:
A, B = map(int, input().split())
 
C = A+B
D = A-B
E = A*B
 
LIST = [C,D,E]
 
print(max(LIST))

Buggy python submission (verdict: Runtime Error):
import numpy
A, B = map(int, input().split())

C = print(A + B)
D = print(A - B)
E = print(A*B)

if C > D and C > E:
    print(C) 
elif D > C and D > E:
    print(D)
elif E > C and E > D:
    print(E)

Fixed submission:
A, B = map(int, input().split())
 
C = A+B
D = A-B
E = A*B
 
LIST = [C,D,E]
 
print(max(LIST))

Buggy python submission (verdict: Runtime Error):
A, B = map(int, input().split())

AprasuB = print(A + B)
AmainasuB = print(A - B)
AkakeruB = print(A*B)

if AmainasuB > AprasuB and AmainasuB > AkakeruB:
    print(AmainasuB) 
elif AprasuB > AmainasuB and AprasuB > AkakeruB:
    print(AprasuB)
elif AkakeruB > AmainasuB and AkakeruB > AprasuB:
    print(AkakeruB)

Fixed submission:
A, B = map(int, input().split())
 
C = A+B
D = A-B
E = A*B
 
LIST = [C,D,E]
 
print(max(LIST))
Buggy python submission (verdict: Runtime Error):
N = int(input())
ans = 0

#Pythonのfor文range()の右側<最大値>は書いている値から-1されるものなので、注意する。(+1する)

for i in range(1, N + 1):

    if len(str(i)) % 2 == 1:
        ans += 1

print(ans)


Fixed submission:
A,B,C = map(int,input().split())


#容器1に残りどの位の容量があるか。
D = C-(A-B)

if D>=0:
    print(D)
else:
    print("0")
Buggy python submission (verdict: Runtime Error):
N = int(input())
ans = 0

#Pythonのfor文range()の右側<最大値>は書いている値から-1されるものなので、注意する。(+1する)

for i in range(1, N + 1):
    if len(str(i)) % 2 == 1:
    ans += 1

print(ans)


Fixed submission:
N = int(input())
ans = 0

#Pythonのfor文range()の右側<最大値>は書いている値から-1されるものなので、注意する。(+1する)

for i in range(1, N + 1):

    if len(str(i)) % 2 == 1:
        ans += 1

print(ans)
Buggy python submission (verdict: Runtime Error):
#もし最初に与えられていたリストが昇順(done)

#1番目とn番目の文字列を消去したリストを作成する。そのリストが昇順ならまずは第一段階クリア
#そして最初に与えられた文字のリストで、(<一番最後の文字> - <一番最初の文字>　+1)なら成立する。

#実装すれば、勝ちなはず。

N = int(input())
P = list(map(int, input().split()))



#初期リストを昇順に(done)
ascending_order = P.sort()



#1番目と一番最後を削除したリスト
Test_P = P[1:N-1]

#TestPの昇順
ascending_TestP = Test_P.sort()

Check = (abs((P[-1] + P[0]) +1)) 

if P == ascending_order:
    print("YES")
elif Test_P != ascending_TestP:
    print("NO")
else:
    print("YES")

Fixed submission:
a,b = map(int,input().split())

 
if (a+b)%2==0:
    print((a+b)//2)
else:
    print("IMPOSSIBLE")
Buggy python submission (verdict: Runtime Error):
N = int(input())
P = list(map(int, input().split()))

ans = 0

for i in range(n):
  if P[i] != i + 1:
    ans += 1
if ans <= 2:
  print('YES')
else:
  print('NO')

Fixed submission:
n = int(input())
p = list(map(int, input().split()))
z = 0
for i in range(n):
  if p[i] != i + 1:
    z += 1
if z <= 2:
  print('YES')
else:
  print('NO')
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = [int(input()) for _ in range(N)]

for i in range(N):
    A_num = A.pop(i)
    print(max(A))
    A.insert(i, A_num)


Fixed submission:
n = int(input())
a = [int(input()) for _ in range(n)]
b = sorted(a)[::-1]
mx = b[0]
mx2 = b[1]

for i in a:
    if i == mx:
        print(mx2)
    else:
        print(mx)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = [int(input()) for _ in range(N)]

for i in range(N):
    A_num = A.pop(i)
    print(max(A))
    A.insert(i, A_num)

Fixed submission:
n = int(input())
a = [int(input()) for _ in range(n)]
b = sorted(a)[::-1]
mx = b[0]
mx2 = b[1]

for i in a:
    if i == mx:
        print(mx2)
    else:
        print(mx)
Buggy python submission (verdict: Runtime Error):
import sys 
L,R = map(int, input().split())

if R-L >= 2019:
    print(0)
    sys.exit()
elif R-L == 1:
    print((i*j)%2019)
    sys.exit()

ans = 4000

for i in range(L,R):
    for j in range(i+1,R):
        number = (i*j)%2019
        ans = min(ans,number)

print(ans)  

Fixed submission:
N,A,B = map(int,input().split())

#電車の時
TRAIN = N*A

TAXI = B

if TRAIN > TAXI:
    print(TAXI)
else:
    print(TRAIN)
Buggy python submission (verdict: Runtime Error):
b

Fixed submission:
n,d = map(int,input().split())
pnt = [list(map(int,input().split())) for _ in range(n)]




def dst(i, j):
    a = pnt[i]
    b = pnt[j]
    ret = 0
    for p, q in zip(a, b):
        ret += (p - q) ** 2
    r = ((ret ** (0.5)))

    return r


ans = 0
for i in range(n):
    for j in range(i + 1, n):
        tmp = dst(i, j)
        if tmp == int(tmp):
            ans = ans + 1 

print(ans)
Buggy python submission (verdict: Runtime Error):
import sys 
L,R = map(int, input().split())

if R-L >= 2019:
    print(0)
    sys.exit()
elif R-L == 1:
    print((i*j)%2019)
    sys.exit()

ans = 4000

for i in range(L,R):
    for j in range(i+1,R):
        number = (i*j)%2019
        ans = min(ans,number)

print(ans)  

Fixed submission:
import sys 
L,R = map(int, input().split())

if R-L >= 2019:
    print(0)
    sys.exit()
elif R-L == 1:
    print((R*L)%2019)
    sys.exit()

ans = 4000

for i in range(L,R):
    for j in range(i+1,R+1):
        number = (i*j)%2019
        ans = min(ans,number)

print(ans)

Buggy python submission (verdict: Runtime Error):
import sys 
L,R = map(int, input().split())

if R-L >= 2019:
    print(0)
    sys.exit()
elif R-L == 1:
    print((i*j)%2019)
    sys.exit()

ans = 100*100

for i in range(L,R):
    for j in range(i+1,R):
        number = (i*j)%2019
        ans = min(ans,number)

print(ans)  

Fixed submission:
import sys 
L,R = map(int, input().split())

if R-L >= 2019:
    print(0)
    sys.exit()
elif R-L == 1:
    print((R*L)%2019)
    sys.exit()

ans = 4000

for i in range(L,R):
    for j in range(i+1,R+1):
        number = (i*j)%2019
        ans = min(ans,number)

print(ans)

Buggy python submission (verdict: Runtime Error):
import sys 
L,R = map(int, input().split())

if R-L >= 2019:
    print(0)
    sys.exit()
elif R-L == 1:
    print((i*j)%2019)
    sys.exit()

ans = float('inf')

for i in range(L,R):
    for j in range(i+1,R):
        number = (i*j)%2019
        ans = min(ans,number)

print(ans)  

Fixed submission:
import sys 
L,R = map(int, input().split())

if R-L >= 2019:
    print(0)
    sys.exit()
elif R-L == 1:
    print((R*L)%2019)
    sys.exit()

ans = 4000

for i in range(L,R):
    for j in range(i+1,R+1):
        number = (i*j)%2019
        ans = min(ans,number)

print(ans)

Buggy python submission (verdict: Runtime Error):
import sys 
L,R = map(int, input().split())

if R-L >= 2019:
    print(0)
    sys.exit()
elif R-L == 1:
    print((i*j)%2019)
    sys.exit()

ans = 10**1000

for i in range(L,R):
    for j in range(i+1,R):
        number = (i*j)%2019
        ans = min(ans,number)

print(ans)  

Fixed submission:
import sys 
L,R = map(int, input().split())

if R-L >= 2019:
    print(0)
    sys.exit()
elif R-L == 1:
    print((R*L)%2019)
    sys.exit()

ans = 4000

for i in range(L,R):
    for j in range(i+1,R+1):
        number = (i*j)%2019
        ans = min(ans,number)

print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
p = list(map(int, input().split()))

ans = 0

#+2まで考慮してるから、nの数を-2にして調整しろ
for i in range(n-2):
	if p[i] < p[i + 1] < p[i + 2] or p[i + 2] < p[i + 1] < p[i]:
		ans = ans + 1

print(ans)

Fixed submission:
S = input()
if S[0] == S[1] == S[2] == S[3]:
  print('No')
elif (S[0] == S[1] and S[2] == S[3]) or (S[0] == S[2] and S[1] == S[3]) or (S[0] == S[3] and S[1] == S[2]):
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
n = int(input())
p = list(map(int, input().split()))

ans = 0

#+2まで考慮してるから、nの数を-2にして調整しろ
for i in range(n):
	if p[i] < p[i + 1] < p[i + 2] or p[i + 2] < p[i + 1] < p[i]:
		ans = ans + 1

print(ans)

Fixed submission:
n = int(input())
p = list(map(int, input().split()))

ans = 0

#+2まで考慮してるから、nの数を-2にして調整しろ
for i in range(n-2):
	if p[i] < p[i + 1] < p[i + 2] or p[i + 2] < p[i + 1] < p[i]:
		ans = ans + 1

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import sys
import math
N = int(input())
d = list(map(int, input().split()))


ans = 0

for i in range(min(d),max(d) + 1):
    ARC = 0
    ABC = 0
    for j in range(N):
        if d[j] < i:
            ARC = ARC + 1
        else:
            ABC = ABC + 1
    if ABC == ARC:
        ans = ans + 1 

print(ans)
             

Fixed submission:
N = int(input())
d = sorted(list(map(int, input().split())))
print(d[N // 2] - d[N // 2 - 1])
Buggy python submission (verdict: Runtime Error):
b

Fixed submission:
N = int(input())
W = list(map(int, input().split()))

ans = []

for i in range(N):
    mae = sum(W[:i])
    usiro = sum(W[i:]) 
    abus = abs((mae)-(usiro))
    ans.append(abus)

print(min(ans))
Buggy python submission (verdict: Runtime Error):
a

Fixed submission:
n=int(input())
sp=[]
for i in range(n):
    s,p=input().split()
    sp.append([s,int(p),i+1])
sp.sort(key=lambda sp:(sp[0],-sp[1]))
for i in sp:print(i[2])
Buggy python submission (verdict: Runtime Error):
N,K = map(str, input().split())
S = int(input())


#n番目の文字を指定されたら n-1番目が真の指定

number = (K-1)

if S[number] == "A":
    S[number] = "a"
elif S[number] == "B":
    S[number] = "b"
elif S[number] == "C":
    S[number] = "c"     

print("".join(s))

Fixed submission:
n, k = map(int,input().split())
s = list(input())
 
if s[k-1] == "A":
  s[k-1] = "a"
elif s[k-1] == "B":
  s[k-1] = "b"
elif s[k-1] == "C":
  s[k-1] = "c"
 
print("".join(s))

Buggy python submission (verdict: Runtime Error):
N,K = map(str, input().split())
S = int(input())


#n番目の文字を指定されたら n-1番目が真の指定

number = (K-1)

if S[number] == "A":
    S[number] = "a"
elif S[number] == "B":
    S[number] = "b"
elif S[number] == "C":
    S[number] = "c"     

print(S)

Fixed submission:
n, k = map(int,input().split())
s = list(input())
 
if s[k-1] == "A":
  s[k-1] = "a"
elif s[k-1] == "B":
  s[k-1] = "b"
elif s[k-1] == "C":
  s[k-1] = "c"
 
print("".join(s))

Buggy python submission (verdict: Runtime Error):
N,K = map(int, input().split())
S = input()


if S[K-1] == "A":
    S[K-1] = "a"
elif S[K-1] == "B":
    S[K-1] = "b"
elif S[K-1] == "C":
    S[K-1] = "c"

print("".join(S))

Fixed submission:
n, k = map(int,input().split())
s = list(input())
 
if s[k-1] == "A":
  s[k-1] = "a"
elif s[k-1] == "B":
  s[k-1] = "b"
elif s[k-1] == "C":
  s[k-1] = "c"
 
print("".join(s))

Buggy python submission (verdict: Runtime Error):
if S[K-1] == "A":
    S[K-1] = "a"
elif S[K-1] == "B":
    S[K-1] = "b"
elif S[K-1] == "C":
    S[K-1] = "c"

print("".join(S))

Fixed submission:
n, k = map(int,input().split())
s = list(input())
 
if s[k-1] == "A":
  s[k-1] = "a"
elif s[k-1] == "B":
  s[k-1] = "b"
elif s[k-1] == "C":
  s[k-1] = "c"
 
print("".join(s))

Buggy python submission (verdict: Runtime Error):
N,K = map(int, input().split())
S = input()


if S[K+1] == "A":
    S[K+1] = "a"
elif S[K+1] == "B":
    S[K+1] = "b"
elif S[K+1] == "C":
    S[K+1] = "c"

print("".join(S))

Fixed submission:
n, k = map(int,input().split())
s = list(input())
 
if s[k-1] == "A":
  s[k-1] = "a"
elif s[k-1] == "B":
  s[k-1] = "b"
elif s[k-1] == "C":
  s[k-1] = "c"
 
print("".join(s))

Buggy python submission (verdict: Runtime Error):
N,K = map(int, input().split())
S = input()


if S[K] == "A":
    S[K] = "a"
elif S[K] == "B":
    S[K] = "b"
elif S[K] == "C":
    S[K] = "c"

print("".join(S))

Fixed submission:
n, k = map(int,input().split())
s = list(input())
 
if s[k-1] == "A":
  s[k-1] = "a"
elif s[k-1] == "B":
  s[k-1] = "b"
elif s[k-1] == "C":
  s[k-1] = "c"
 
print("".join(s))

Buggy python submission (verdict: Runtime Error):
N,K = map(int, input().split())
S = input()


if S[K] == "A":
    S[K] = "a"
elif S[K] == "B":
    S[K] = "b"
elif S[K] == "C":
    S[K] = "c"

print(S)

Fixed submission:
n, k = map(int,input().split())
s = list(input())
 
if s[k-1] == "A":
  s[k-1] = "a"
elif s[k-1] == "B":
  s[k-1] = "b"
elif s[k-1] == "C":
  s[k-1] = "c"
 
print("".join(s))
Buggy python submission (verdict: Runtime Error):
S = input()

if  0 < int(S[0:2]) <=12  and 0 < (int(S[2:4])) <= 12:
    print("AMBIGUOUS")
elif int(S[0:2]) > 12 and 0 < (int(S[2:4])) <= 12:
    print("YYMM")
elif 0 < int(S[0:2]) <= 12 and int(S[2:4]) > 12:
    print("MMYY")
elif int(S[0:2]) == and 0 < (int(S[2:4])) <= 12:
    print("YYMM")
elif 0 < int(S[0:2]) <= 12  and 0 < (int(S[2:4])) == 0:
    print("MMYY")
else:
    print("NA")

Fixed submission:
S=input()
A=int(S[:2])
B=int(S[2:])
if 1<=A<=12:
    if 1<=B<=12:
        print("AMBIGUOUS")
    else:
        print("MMYY")
else:
    if 1<=B<=12:
        print("YYMM")
    else:
        print("NA")
Buggy python submission (verdict: Runtime Error):
import math
N, K = map(int, input().split())

expo = (math.ceil(math.log(K,2)))

ans = 0
bunbo = 1/N
for i in range(N):
    ans = ans + (bunbo * (1/2)**expo)
    expo = expo - 1

print(ans)

Fixed submission:
import math
N, K = map(int, input().split())
p = 0
for i in range(1,N+1):
  if i < K:
    times = math.ceil(math.log2(K/i))
    p = p + (1/N)*(1/2)**times
  else:
    p = p + (1/N)
print(p)
Buggy python submission (verdict: Time Limit Exceeded):
R,G,B,N = map(int, input().split())

count = 0

for r in range(3001):
    for g in range(3001):
        redball = r*R
        greenball = g*G
        tempbull = N - (redball + greenball)
        
        if (redball >= 0) and (greenball >= 0) and (tempbull >= 0):
            if (redball + greenball + tempbull == N) and (tempbull % B == 0):
                count = count + 1

print(count)

Fixed submission:
R,G,B,N = map(int, input().split())

count = 0

for r in range(3001):
    for g in range(3001):
        redball = r*R
        greenball = g*G
        tempbull = N - (redball + greenball)
        
        if (redball >= 0) and (greenball >= 0) and (tempbull >= 0):
            if (redball + greenball + tempbull == N) and (tempbull % B == 0):
                count = count + 1

print(count)
Buggy python submission (verdict: Runtime Error):
A = input()

ans = 0

ALEN = (len(A))

B = list(A)



B_re =  list(reversed(B))

ans = 0


for i in range(ALEN):
    if B[i] != B_re[i]:
        ans = ans+1
    
if ans　% 2 == 0:
    print(ans//2)
elif ans %2 != 0:
    print((ans//2) +1)
elif ans == 0:
    print(0)

Fixed submission:
N = int(input())
V = list(map(int, input().split()))
C = list(map(int, input().split()))

ans = 0

for i in range(N):
    if ((V[i]) - (C[i])) >= 0:
        ans = ans + ((V[i]) - (C[i]))

print(ans)
Buggy python submission (verdict: Runtime Error):
A,B,C = map(int, input().split())


if A<C<B or B<C<A
    print("Yes")
else:
    print("No")

Fixed submission:
A,B,C = map(int, input().split())


#もし家1と家2までの距離
if A<C<B or B<C<A:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
A = int(input())
B = int(input())

OnlyA = A+(A-1)
 
OnlyB = B+(B-1)
 
AaddB = A + B
 
print(max([OnlyA,OnlyB,AaddB]))

Fixed submission:
A,B= map(int, input().split())

OnlyA = A+(A-1)

OnlyB = B+(B-1)

AaddB = A + B

print(max([OnlyA,OnlyB,AaddB]))

Buggy python submission (verdict: Runtime Error):
A,B= [int(input()) for i in range(2)]  
OnlyA = A+(A-1)

OnlyB = B+(B-1)

AaddB = A + B

print(max([OnlyA,OnlyB,AaddB]))


Fixed submission:
A,B= map(int, input().split())

OnlyA = A+(A-1)

OnlyB = B+(B-1)

AaddB = A + B

print(max([OnlyA,OnlyB,AaddB]))

Buggy python submission (verdict: Runtime Error):
A,B= map(int, input().split())

OnlyA = A+(A-1)

OnlyB = B+(B-1)

AaddB = A + B

print(max[OnlyA,OnlyB,AaddB])

Fixed submission:
A,B= map(int, input().split())

OnlyA = A+(A-1)

OnlyB = B+(B-1)

AaddB = A + B

print(max([OnlyA,OnlyB,AaddB]))
Buggy python submission (verdict: Runtime Error):
a


Fixed submission:
import itertools

A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())



dish = [A,B,C,D,E]

combination = list(itertools.permutations(dish))

ans = []
count = 0

for i in combination:
    time = 0
    for j in i:
        if count != 4:
            time = time + j
            if time % 10 != 0:
                while time % 10 != 0:
                    time = time + 1
            count = count+1
        elif count == 4:
            time = time + j
            count = 0
            ans.append(time)

print(min(ans))
Buggy python submission (verdict: Runtime Error):
b = input()

if b == A:
    print("T")
elif b == T:
    print("C")
elif b == C:
    print("G")
elif b == G:
    print("C")


Fixed submission:
b = input()

if b == "A":
    print("T")
elif b == "T":
    print("A")
elif b == "C":
    print("G")
elif b == "G":
    print("C")

Buggy python submission (verdict: Runtime Error):
b = input()

if b==A:
    print("T")
elif b==T:
    print("C")
elif b==C:
    print("G")
elif b==G:
    print("C")

Fixed submission:
b = input()

if b == "A":
    print("T")
elif b == "T":
    print("A")
elif b == "C":
    print("G")
elif b == "G":
    print("C")
Buggy python submission (verdict: Runtime Error):
a

Fixed submission:
N,M,C = map(int, input().split())
B = list(map(int, input().split()))

ans = 0

for i in range(N):
    A = list(map(int, input().split()))
    check = C

    for i,j in zip(A,B):
        check = check + (i*j)

    if check > 0:
        ans = ans + 1

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import sys
N, M = map(int, input().split())

lis_A = []
lis_B = []

for _ in range(N):
    A, B = map(int, input().split())
    lis_A.append(A)
    lis_B.append(B)

cost  = 0
count  = 0

while True:
    if N == 1:
        print(lis_A[0] * lis_B[0])
        sys.exit()
    saiyasu = lis_A.index(min(lis_A))



    #ものを買う時に、Mをオーバーするなら処理
    if (lis_B[saiyasu] + count) <= M:
        cost = ((lis_B[saiyasu] * lis_A[saiyasu]) + cost)
        count  = lis_B[saiyasu] + count
        lis_A.pop(saiyasu)
        lis_B.pop(saiyasu)
    else:
        cost = (((M - count) * lis_A[saiyasu]) + cost)
        break
print(cost)


Fixed submission:
import sys
N, M = map(int, input().split())

lis_A = []
lis_B = []

for _ in range(N):
    A, B = map(int, input().split())
    lis_A.append(A)
    lis_B.append(B)

c = zip(lis_A, lis_B)
sorted_c = sorted(c)
lis_A, lis_B = zip(*sorted_c)


cost  = 0
count  = 0

while True:
    if N == 1:
        print(lis_A[0] * lis_B[0])
        sys.exit()


    for i in range(len(lis_A)):
        if (lis_B[i] + count) <= M:
            cost = (lis_A[i]*lis_B[i]) + cost
            count = lis_B[i] + count
        else:
            cost = (((M - count) * lis_A[i]) + cost)
            print(cost)
            sys.exit()
Buggy python submission (verdict: Runtime Error):
A,B = map(int, input().split())

BDA = B/A

if isinstance(n, int) == True:
    print(A+B)
else:
    print(A-B)

Fixed submission:
a,b = map(int,input().split())
 
if b % a == 0:
    print(a+b)
else:
    print(b-a)
Buggy python submission (verdict: Runtime Error):
a

Fixed submission:
N, M = map(int, input().split())

all_lis = []

for i in range(N):
    A = list(map(int, input().split()))
    A.pop(0)
    all_lis.extend(A)

ans = 0
ans_lis2 = []

for j in set(all_lis):
    ans = all_lis.count(j)
    ans_lis2.append(ans)

ans2 = 0 
for k in ans_lis2:
    if k == N:
        ans2 = ans2 + 1

print(ans2)
Buggy python submission (verdict: Runtime Error):
import sys 
N, M = map(int, input().split())
X = list(map(int, input().split()))

X = sorted(X)

anslis = []


if M <= N:
    print(0)
    sys.exit()


    
for i in range(M-1):
    ans = abs(X[i+1] - X[i])
    anslis.append(ans)
    ans = 0

anslis = sorted(anslis)

if N==1:
    print(sum(anslis))
else:
    print(sum(anslis[0:M-N]))

Fixed submission:
T, X = map(int, input().split())
print(T / X)

Buggy python submission (verdict: Runtime Error):
import sys 
N, M = map(int, input().split())
X = list(map(int, input().split()))

X = sorted(X)

anslis = []


if M <= N:
    print(0)
    sys.exit()


    
for i in range(M-1):
    ans = abs(X[i+1] - X[i])
    anslis.append(ans)
    ans = 0

anslis = sorted(anslis)

if N==1:
    print(sum(anslis))
else:
    print(sum(anslis[0:N+1]))


Fixed submission:
T, X = map(int, input().split())
print(T / X)

Buggy python submission (verdict: Runtime Error):
import sys 
N, M = map(int, input().split())
X = list(map(int, input().split()))

X = sorted(X)

anslis = []


if M <= N:
    print(0)
    sys.exit()


    
for i in range(M-1):
    ans = abs(X[i+1] - X[i])
    anslis.append(ans)
    ans = 0

anslis = sorted(anslis)

print(sum(anslis[0:N-1]))


Fixed submission:
T, X = map(int, input().split())
print(T / X)

Buggy python submission (verdict: Runtime Error):
N = int(input())
L = sorted([int(_) for _ in input().split()])
if L[N - 1] < sum(L[:N - 1]):
    print('Yes')
else:
    print('No')

Fixed submission:
T, X = map(int, input().split())
print(T / X)

Buggy python submission (verdict: Runtime Error):
N = int(input())
L = list(map(int, input().split()))

L_max = max(L)

print(L_max)

L_Down =sorted(L,reverse=True)

print(L_Down)

L_Down_Re = L_Down[1:len(L_Down)]

print(L_Down_Re)

L_Down_Re_Sum =  sum(L_Down_Re)

print(L_Down_Re_Sum)

if L_max <= L_Down_Re_Sum:
    print("Yes")
else:
    print("No")

Fixed submission:
T, X = map(int, input().split())
print(T / X)

Buggy python submission (verdict: Runtime Error):
x,y,r = map(int,input().split())

AREA = x*y

AREA2 =(AREA/2) 


print(AREA2)


Fixed submission:
T, X = map(int, input().split())
print(T / X)
Buggy python submission (verdict: Runtime Error):
N = int(input())
L = list(map(int, input().split()))


L_max = max(L)

L_Down = L.sort(reverse=True)

L_Down_Re = L.Down[1:len(L_Down)]

L_Down_Re_Sum =  sum(L_Down_Re)

if L_max <= L_Down_Re_Sum:
    print("No")
else:
    print("Yes")

Fixed submission:
N = int(input())
L = sorted([int(_) for _ in input().split()])
if L[N - 1] < sum(L[:N - 1]):
    print('Yes')
else:
    print('No')