Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
import bisect

N = int(input())

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

A.sort()

ans = 0
for a in range(N-2):
    for b in range(a+1, N-1):
        ans += bisect.bisect_left(A, A[a]+A[b])-j-1

print(ans)

Fixed submission:
import bisect

N = int(input())

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

A.sort()

ans = 0
for a in range(N-2):
    for b in range(a+1, N-1):
        ans += bisect.bisect_left(A, A[a]+A[b])-b-1

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())

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

A.sort()

ans = 0
for a in range(N-2):
    for b in range(a+1, N-1):
        for c in range(b+1, N):
            if A[c] < (A[a] + A[b]):
                ans += 1
            else:
                break

print(ans)

Fixed submission:
import bisect

N = int(input())

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

A.sort()

ans = 0
for a in range(N-2):
    for b in range(a+1, N-1):
        ans += bisect.bisect_left(A, A[a]+A[b])-b-1

print(ans)

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

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

A.sort()

ans = 0
for a in range(N-2):
    for b in range(a+1, N-1):
        for c in range(b+1, N):
            if A[c] < (A[a] + A[b]):
                ans += 1
            else:
                break

print(ans)

Fixed submission:
import bisect

N = int(input())

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

A.sort()

ans = 0
for a in range(N-2):
    for b in range(a+1, N-1):
        ans += bisect.bisect_left(A, A[a]+A[b])-b-1

print(ans)

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

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

A.sort()

ans = 0
for a in range(N-2):
    for b in range(a+1, N-1):
        for c in range(b+1, N):
            if A[c] < (A[a] + A[b]):
                ans += 1
                print(a, b, c)
            else:
                break

print(ans)

Fixed submission:
import bisect

N = int(input())

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

A.sort()

ans = 0
for a in range(N-2):
    for b in range(a+1, N-1):
        ans += bisect.bisect_left(A, A[a]+A[b])-b-1

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
print(*[1+A.index(i) for i in range(1, N+1)])

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
B = [[A[i], i+1] for i in range(N)]
B = sorted(B, key=lambda x:x[0])
print(*[B[i][1] for i in range(N)])

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))

ans=[]
for i in range(1, N+1):
    ans.append(1+A.index(i))

print(*ans, sep=" ")

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
B = [[A[i], i+1] for i in range(N)]
B = sorted(B, key=lambda x:x[0])
print(*[B[i][1] for i in range(N)])
Buggy python submission (verdict: Runtime Error):
S = input()
print("Sunny" if S==""Rainy else "Cloudy" if S=="Sunny else "Rainy")

Fixed submission:
S = input()
print("Sunny" if S=="Rainy" else "Cloudy" if S=="Sunny" else "Rainy")
Buggy python submission (verdict: Runtime Error):
N = int(input())

print(sum(list(range(1, N))))

Fixed submission:
N = int(input())

print((N-1)*N//2)

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

print(sum(list(range(1, N))))

Fixed submission:
N = int(input())

print((N-1)*N//2)
Buggy python submission (verdict: Runtime Error):
N, Q = map(int, input().split())

G=[[0]*N]
ans =[0]*N
for i in range(N-1):
    a, b = map(int, input().split())
    G[a-1] = b-1
    G[b-1] = a-1

for i in range(Q):
    p, x = map(int, input().split())
    for j in range(len(G[p-1])):
        ans[j] += x

print(*ans, sep=" ")

Fixed submission:
from collections import deque

N, Q = map(int, input().split())

G=[[] for i in range(N)]
A =[0]*N

for i in range(N-1):
    a, b = map(int, input().split())
    G[a-1].append(b-1)
    G[b-1].append(a-1)

for i in range(Q):
    p, x = map(int, input().split())
    A[p-1] += x

queue = deque([0])
visited= [0]*N
while queue:
    a = queue.popleft()
    visited[0] = 1
    for i in G[a]:
        if visited[i] == 0:
            A[i] += A[a]
            visited[a] = 1
            queue.append(i)

print(*A)
Buggy python submission (verdict: Runtime Error):
import collections
N = int(input())
A=[]
for i in range(N):
    x= sorted(list(input()))
    A.append(x)
B=collections.Counter(A)
ans = 0
for i in B.values():
    ans += i*(i-1)//2
print(ans)

Fixed submission:
import collections
N = int(input())
A=[]
for i in range(N):
    x= str(sorted(input()))
    A.append(x)
B=collections.Counter(A)
ans = 0
for i in B.values():
    ans += i*(i-1)//2
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
dictionary={}
count=0
for i in range(N):
    s=str(sorted(input()))
    if s in dictionary:
        dictionary[s]+=1
        count+=dictionary[s]
    else:
        dictionary[s]=0
print(count)

Fixed submission:
import collections
N = int(input())
A=[]
for i in range(N):
    x= str(sorted(input()))
    A.append(x)
B=collections.Counter(A)
ans = 0
for i in B.values():
    ans += i*(i-1)//2
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
D={}
ans = 0
for i in range(N):
    a = str(sorted(input()))
    if a in D:
        D[a] += 1
        ans += D[a]
    else:
        D[a] = 0
print(ans)

Fixed submission:
import collections
N = int(input())
A=[]
for i in range(N):
    x= str(sorted(input()))
    A.append(x)
B=collections.Counter(A)
ans = 0
for i in B.values():
    ans += i*(i-1)//2
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A=[]
for i in range(N):
    x= sorted(list(input()))
    A.append(x)
ans = 0
for i in range(N):
    ans += A[i+1:].count(A[i])
print(ans)

Fixed submission:
import collections
N = int(input())
A=[]
for i in range(N):
    x= str(sorted(input()))
    A.append(x)
B=collections.Counter(A)
ans = 0
for i in B.values():
    ans += i*(i-1)//2
print(ans)
Buggy python submission (verdict: Runtime Error):
A, B, C = map(int, input().split())
print(max(C-(A-B)), 0)

Fixed submission:
A, B, C = map(int, input().split())
print(max(C-(A-B), 0))
Buggy python submission (verdict: Runtime Error):
S = list(input())

ans = [0]*(len(S))
cnt = 0
for i in range(len(S)-1):
    cnt += 1
    if S[i] == "R" and S[i+1] =="L":
        ans[i] += -(-cnt//2)
        ans[i+1] += cnt//2
        x = i
        cnt = 0
    if S[i] == "L" and S[i+1] =="R" or :
        ans[x] += cnt//2
        ans[x+1] += -(-cnt//2)
        cnt = 0
    if i == len(S)-2:
        cnt += 1
        ans[x] += cnt//2
        ans[x+1] += -(-cnt//2)    

print(*ans)

Fixed submission:
S = input()

ans = [0]*(len(S))
cnt = 0
for i in range(len(S)-1):
    cnt += 1
    if S[i] == "R" and S[i+1] =="L":
        ans[i] += -(-cnt//2)
        ans[i+1] += cnt//2
        x = i
        cnt = 0
    if S[i] == "L" and S[i+1] =="R":
        ans[x] += cnt//2
        ans[x+1] += -(-cnt//2)
        cnt = 0
    if i == len(S)-2:
        cnt += 1
        ans[x] += cnt//2
        ans[x+1] += -(-cnt//2)    

print(*ans)

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


ans = [0]*(len(S))
cnt = 0
for i in range(len(S)-1):
    cnt += 1
    if S[i] == "R" and S[i+1] =="L":
        ans[i] += -(-cnt//2)
        ans[i+1] += cnt//2
        x = i
        cnt = 0
    if S[i] == "L" and S[i+1] =="R" or :
        ans[x] += cnt//2
        ans[x+1] += -(-cnt//2)
        cnt = 0
    if i == len(S)-2:
        cnt += 1
        ans[x] += cnt//2
        ans[x+1] += -(-cnt//2)
        

print(*ans)

Fixed submission:
S = input()

ans = [0]*(len(S))
cnt = 0
for i in range(len(S)-1):
    cnt += 1
    if S[i] == "R" and S[i+1] =="L":
        ans[i] += -(-cnt//2)
        ans[i+1] += cnt//2
        x = i
        cnt = 0
    if S[i] == "L" and S[i+1] =="R":
        ans[x] += cnt//2
        ans[x+1] += -(-cnt//2)
        cnt = 0
    if i == len(S)-2:
        cnt += 1
        ans[x] += cnt//2
        ans[x+1] += -(-cnt//2)    

print(*ans)
Buggy python submission (verdict: Time Limit Exceeded):
A, B = map(int, input().split())
a = min(A, B)
b = max(A, B)
for i in range(a, b):
    if abs(a-i) == abs(b-i):
        print(i)
        break
else:
    print("IMPOSSIBLE")

Fixed submission:
A, B = map(int, input().split())
a = min(A, B)
b = max(A, B)
if (b-a)%2 == 0:
    print(a+(b-a)//2)
else:
    print("IMPOSSIBLE")
Buggy python submission (verdict: Runtime Error):
N = input()
A=[]
for i in range(N-1):
    A.append(int(input()))
B=sorte(A, reverse=True)
for i in range(N-1):
    if A[i] == B[0]:
        print(B[1])
    else:
        print(B[0]) 

Fixed submission:
N = int(input())
A=[]
for i in range(N):
    A.append(int(input()))
B=sorted(A, reverse=True)
for i in range(N):
    if A[i] == B[0]:
        print(B[1])
    else:
        print(B[0])
Buggy python submission (verdict: Time Limit Exceeded):
L, R = map(int, input().split())
saidai = float("inf")
for i in range(L, R):
    for j in range(L+1, R+1):
        saidai = min(saidai, i*j%2019)
print(saidai)

Fixed submission:
L, R = map(int, input().split())
if R-L >= 2019:
    print(0)
else:
    saidai = float("inf")
    for i in range(L, R):
        for j in range(L+1, R+1):
            saidai = min(saidai, i*j%2019)
    print(saidai)
Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
mod = 10**9 + 7

def com(n, r):
    p, q = 1, 1
    for i in range(r):
        p *= ((n-i)%mod)
        q *= ((r-i)%mod)
    return p*pow(q, mod-2, mod)%mod

for k in range(1, K+1):
    print(com(N-K+1, k)*com(K-1, k-1)%mod)

Fixed submission:
N, K = map(int, input().split())
mod = 10**9 + 7

def com(n, r):
    p, q = 1, 1
    for i in range(r):
        p = p*(n-i)%mod
        q = q*(r-i)%mod
    return p*pow(q, mod-2, mod)%mod

for k in range(1, K+1):
    print(com(N-K+1, k)*com(K-1, k-1)%mod)

Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
mod = 10**9 + 7

def com(n, r):
    p, q = 1, 1
    for i in range(r):
        p *= (n-i)%mod
        q *= (r-i)%mod
    return p*pow(q, mod-2, mod)%mod

for k in range(1, K+1):
    print(com(N-K+1, k)*com(K-1, k-1)%mod)

Fixed submission:
N, K = map(int, input().split())
mod = 10**9 + 7

def com(n, r):
    p, q = 1, 1
    for i in range(r):
        p = p*(n-i)%mod
        q = q*(r-i)%mod
    return p*pow(q, mod-2, mod)%mod

for k in range(1, K+1):
    print(com(N-K+1, k)*com(K-1, k-1)%mod)
Buggy python submission (verdict: Runtime Error):
from functools import reduce
from fractions import gcd
import math

A, B, C, D = map(int, input().split())
X = C//math.gcd(C, D)*(D//math.gcd(C, D))*math.gcd(C, D)

print(B-A-(B//C-(-(-A//C))+B//D-(-(-A//D))-(B//X-(-(-A//X)))))

Fixed submission:
from functools import reduce
from fractions import gcd

A, B, C, D = map(int, input().split())
X = C//gcd(C, D)*(D//gcd(C, D))*gcd(C, D)

print(B-A-(B//C-(-(-A//C))+B//D-(-(-A//D))-(B//X-(-(-A//X)))))

Buggy python submission (verdict: Runtime Error):
from functools import reduce
from fractions import gcd

A, B, C, D = map(int, input().split())
X = math.gcd(C, D)*C*D
print(X)

N = B-A+1
print(N-(N//C+N//D-N//X))

Fixed submission:
from functools import reduce
from fractions import gcd

A, B, C, D = map(int, input().split())
X = C//gcd(C, D)*(D//gcd(C, D))*gcd(C, D)

print(B-A-(B//C-(-(-A//C))+B//D-(-(-A//D))-(B//X-(-(-A//X)))))
Buggy python submission (verdict: Runtime Error):
N = int(input())

A = []
for i in range(N):
    A.append(list(map(int, input().split())))

A.sort(lambda x: x[1], x[0])

gokei = 0
for i in A:
    gokei += i[0]
    if gokei > i[1]:
        print("No")
else:
    print("Yes")

Fixed submission:
N = int(input())

A = []
for i in range(N):
    A.append(list(map(int, input().split())))

A.sort(key=lambda x: (x[1], x[0]))

gokei = 0
for i in A:
    gokei += i[0]
    if gokei > i[1]:
        print("No")
        break
else:
    print("Yes")
Buggy python submission (verdict: Runtime Error):
X, A = map(int, input().split())
print(0 if x < A else 10)

Fixed submission:
X, A = map(int, input().split())
print(0 if X < A else 10)
Buggy python submission (verdict: Runtime Error):
W, H, x, y = map(int, input().split())
B=1 if 2*x == W and 2*y = H else B=0
print(W*H/2, B)

Fixed submission:
W, H, x, y = map(int, input().split())
if 2*x == W and 2*y == H:
    B=1
else: 
    B=0
print(W*H/2, B)

Buggy python submission (verdict: Runtime Error):
W, H, x, y = map(int, input().split())
print(W*H/2, 1 if 2*x == W and 2*y = H else 0)


Fixed submission:
W, H, x, y = map(int, input().split())
if 2*x == W and 2*y == H:
    B=1
else: 
    B=0
print(W*H/2, B)
Buggy python submission (verdict: Time Limit Exceeded):
N, M = map(int, input().split())

mod = 1000000007

A = []
for i in range(M):
    A.append(int(input()))
    
DP = [0]*(N+2)
DP[1] = 1

for i in range(2, N+2):
    if i-1 not in A:
        DP[i] =  DP[i-1]%mod + DP[i-2]%mod

print(DP[N+1]%mod)

Fixed submission:
N, M = map(int, input().split())
A = set([int(input()) for i in range(M)])
B = [0]*(N+1)
B[0] = 1
for i in range(1, N+1):
    B[i] = B[i-1] + B[i-2]
    if i in A:
        B[i] = 0
print(B[N]%1000000007)

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

mod = 1000000007

A = []
for i in range(M):
    A.append(int(input()))
    
DP = [0]*(N+2)
DP[1] = 1

for i in range(2, N+2):
    if i-1 not in A:
        DP[i] =  DP[i-1] + DP[i-2]

print(DP[N+1]%mod)

Fixed submission:
N, M = map(int, input().split())
A = set([int(input()) for i in range(M)])
B = [0]*(N+1)
B[0] = 1
for i in range(1, N+1):
    B[i] = B[i-1] + B[i-2]
    if i in A:
        B[i] = 0
print(B[N]%1000000007)
Buggy python submission (verdict: Runtime Error):
N = int(input())
list=[]
for i in range(N):
    s, p = input().split()
    list.append([s, int(p)])
A=list
list.sort(key=lambda, list:(list[0], -list[1]))
for i in A:
    print(list.index(i)+1)

Fixed submission:
N = int(input())
list=[]
for i in range(N):
    s, p = input().split()
    list.append([s, int(p), i+1])
list.sort(key=lambda list:(list[0], -list[1]))
for i in list:
    print(i[2])

Buggy python submission (verdict: Runtime Error):
N = int(input())
list=[]
for i in range(N):
    s, p = input().split()
    list.append([s, int(p)])
lis=sorted(key=lambda, list:(list[0], -list[1]))
for i in list:
    print(lis.index(i)+1)

Fixed submission:
N = int(input())
list=[]
for i in range(N):
    s, p = input().split()
    list.append([s, int(p), i+1])
list.sort(key=lambda list:(list[0], -list[1]))
for i in list:
    print(i[2])
Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
l=[]
for i in range(M):
    L = list(input().split())
    l.append(l[1:]) 
s=list(input().split())
c=0
for i in range(2**N):
    for j in range(M):
        a = 0
        for k range(N):
            if ((i >>k) == 1 and k+1 in l[j]:
                a += 1
        if a%2 == s[j]:
            d *= 1
        else:
            d *= 0
    if d == 1:
        c += 1
print(c)

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

s = []

for i in range(m):
    array = list(map(int, input().split()))
    s.append(array[1:])

check = list(map(int, input().split()))

ans = 0
for i in range(2**n):
    flag =True
    for j in range(m):
        a = 0
        for k in range(n):
            if ((i >>k)&1) == 1 and k+1 in s[j]:
                a += 1
        if a%2 == check[j]:
            continue
        else:
            flag = False
            break
    if flag is True:
        ans += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
S = input()
if 1 <= int(S[:2]) <= 12 and 1 <= int(S[2:]) <= 12:
    print("AMBIGUOUS")
elif int(S[:2]) > 12 and int(S[2:]) != 0:
    print("YYMM")
elif int(S[2:]) > 12 int(S[:2]) != 0:
    print("MMYY")
else:
    print("NA")

Fixed submission:
S = input()
if 1 <= int(S[:2]) <= 12 and 1 <= int(S[2:]) <= 12:
    print("AMBIGUOUS")
elif 1 <= int(S[2:]) <= 12:
    print("YYMM")
elif 1 <= int(S[:2]) <= 12:
    print("MMYY")
else:
    print("NA")
Buggy python submission (verdict: Time Limit Exceeded):
from functools import reduce
from fractions import gcd

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

ans = 1
for i in range(N):
    B = A[:i] + A[i+1:]
    ans = max(ans, reduce(gcd, B))

print(ans)

Fixed submission:
from functools import reduce
from fractions import gcd

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

L = [reduce(gcd, A[1:])]
l = A[0]
for i in range(N-1):
    l = gcd(l, A[i])
    L.append(l)

R = [reduce(gcd, A[:N-1])]
r = A[-1]
for i in range(N-1, 0, -1):
    r = gcd(r, A[i])
    R.append(r)

ans = 1
for i in range(N):
    ans = max(ans, gcd(L[i], R[-(i+1)]))

print(ans)
Buggy python submission (verdict: Runtime Error):
input()
S=input()
K=int(input())
for s in S:
  if s=!S[k-1]:
    s
  else:
    '*'
print(S)

Fixed submission:
input()
S=input()
k=int(input())
for s in S:
  print(s if s==S[k-1] else "*",end="")
Buggy python submission (verdict: Runtime Error):
N = int(input())
H = list(map(int, input().split()))
ans = 1
height = H[0]
for i in range(1, N+1):
    if H[i] >= height:
        ans += 1
        height = H[i]

print(ans)

Fixed submission:
N = int(input())
H = list(map(int, input().split()))
ans = 1
height = H[0]
for i in range(1, N):
    if H[i] >= height:
        ans += 1
        height = H[i]

print(ans)

Buggy python submission (verdict: Runtime Error):
N = int(input())
H = list(map(int, input().split())
ans = 1
height = H[0]
for i in range(1, N+1):
    if H[i] >= height:
        ans += 1
        height = H[i]

print(ans)

Fixed submission:
N = int(input())
H = list(map(int, input().split()))
ans = 1
height = H[0]
for i in range(1, N):
    if H[i] >= height:
        ans += 1
        height = H[i]

print(ans)
Buggy python submission (verdict: Runtime Error):
a, b, c, d, e, k = [int(input()) for in range(6)]


Fixed submission:
a, b, c, d, e, k = [int(input()) for i in range(6)]
print("Yay!" if (e-a)<=k else ":(")

Buggy python submission (verdict: Runtime Error):
a, b, c, d, e, k = [int(input()) for in range(6)]
print("Yey!" if (e-a)<=k else ":(")

Fixed submission:
a, b, c, d, e, k = [int(input()) for i in range(6)]
print("Yay!" if (e-a)<=k else ":(")

Buggy python submission (verdict: Runtime Error):
a, b, c, d, e, k = [int(input()) for in range(6)]
print("Yey!" if (e-a)<=k else ":(")

Fixed submission:
a, b, c, d, e, k = [int(input()) for i in range(6)]
print("Yay!" if (e-a)<=k else ":(")

Buggy python submission (verdict: Runtime Error):
a, b, c, d, e, k = int(input()) for in range(6)
print("Yey!" if (e-a)<=k else ":(")

Fixed submission:
a, b, c, d, e, k = [int(input()) for i in range(6)]
print("Yay!" if (e-a)<=k else ":(")

Buggy python submission (verdict: Runtime Error):
a, b, c, d, e, k = int(input()) for i in range(6)
print("Yey!" if (e-a)<=k else ":(")

Fixed submission:
a, b, c, d, e, k = [int(input()) for i in range(6)]
print("Yay!" if (e-a)<=k else ":(")

Buggy python submission (verdict: Runtime Error):
a, b, c, d, e, k = int(input()) for i range(6)
print("Yey!" if (e-a)<=k else ":(")

Fixed submission:
a, b, c, d, e, k = [int(input()) for i in range(6)]
print("Yay!" if (e-a)<=k else ":(")

Buggy python submission (verdict: Runtime Error):
a, b, c, d, e, k = map(int, input().split())
print("Yey!" if (e-a)<=k else ":(")

Fixed submission:
a, b, c, d, e, k = [int(input()) for i in range(6)]
print("Yay!" if (e-a)<=k else ":(")
Buggy python submission (verdict: Runtime Error):
N, A, B, C, D, E = map(int, input().split())
list=[A, B, C, D, E]
min=min(list)
print(-(-N//min)

Fixed submission:
N=int(input())
A=int(input())
B=int(input())
C=int(input())
D=int(input())
E=int(input())
min=min(A, B, C, D, E)
print(-(-N//min)+4)

Buggy python submission (verdict: Runtime Error):
N, A, B, C, D, E = map(int, input().split())
min=min(A, B, C, D, E)
print(-(-N//min)

Fixed submission:
N=int(input())
A=int(input())
B=int(input())
C=int(input())
D=int(input())
E=int(input())
min=min(A, B, C, D, E)
print(-(-N//min)+4)

Buggy python submission (verdict: Runtime Error):
N, A, B, C, D, E = map(int, input().split())
min=min(A, B, C, D, E)
print(N//min+1)

Fixed submission:
N=int(input())
A=int(input())
B=int(input())
C=int(input())
D=int(input())
E=int(input())
min=min(A, B, C, D, E)
print(-(-N//min)+4)

Buggy python submission (verdict: Runtime Error):
N, A, B, C, D, E = map(int, input().split())
min=min(A, B, C, D, E)
print(-(-N//min))

Fixed submission:
N=int(input())
A=int(input())
B=int(input())
C=int(input())
D=int(input())
E=int(input())
min=min(A, B, C, D, E)
print(-(-N//min)+4)

Buggy python submission (verdict: Runtime Error):
N, A, B, C, D, E = map(int, input().split())
min=min(A, B, C, D, E)
print(-(-N//min))

Fixed submission:
N=int(input())
A=int(input())
B=int(input())
C=int(input())
D=int(input())
E=int(input())
min=min(A, B, C, D, E)
print(-(-N//min)+4)

Buggy python submission (verdict: Runtime Error):
N, A, B, C, D, E = map(int, input().separate())
min=min(A, B, C, D, E)
print(-(-N//min))

Fixed submission:
N=int(input())
A=int(input())
B=int(input())
C=int(input())
D=int(input())
E=int(input())
min=min(A, B, C, D, E)
print(-(-N//min)+4)
Buggy python submission (verdict: Runtime Error):
import re
ans = max(map(len, re.findall("[ACGT]+", input())))
print(ans)

Fixed submission:
S = str(input())
m=0
point=0
for i in S:
    if i == "A" or i == "G" or i == "C" or i == "T":
        point+=1
    else:
        point*=0
    m = max(m, point)
print(m)

Buggy python submission (verdict: Runtime Error):
import re

S=input()
ans = sorted((re.findall("[AGCT]+", S)), reverse=True, key=len)
print(len(ans[0]))


Fixed submission:
S = str(input())
m=0
point=0
for i in S:
    if i == "A" or i == "G" or i == "C" or i == "T":
        point+=1
    else:
        point*=0
    m = max(m, point)
print(m)

Buggy python submission (verdict: Runtime Error):
import re
X=sorted(re.findall("[ACGT]+",input()), key=len)
print(len(X[-1]))

Fixed submission:
S = str(input())
m=0
point=0
for i in S:
    if i == "A" or i == "G" or i == "C" or i == "T":
        point+=1
    else:
        point*=0
    m = max(m, point)
print(m)

Buggy python submission (verdict: Runtime Error):
import re
X=sorted(re.findall("[ACGT]+",input()), key=len)
print(len(X[-1]))

Fixed submission:
S = str(input())
m=0
point=0
for i in S:
    if i == "A" or i == "G" or i == "C" or i == "T":
        point+=1
    else:
        point*=0
    m = max(m, point)
print(m)

Buggy python submission (verdict: Runtime Error):
import re
X=sorted(re.findall("[ACGT]+",input()), len=True)
print(len(X[-1]))

Fixed submission:
S = str(input())
m=0
point=0
for i in S:
    if i == "A" or i == "G" or i == "C" or i == "T":
        point+=1
    else:
        point*=0
    m = max(m, point)
print(m)

Buggy python submission (verdict: Runtime Error):
import re

S=input()
ans = sorted((re.findall("[AGCT]*", S)), reverse=True, key=len)
print(len(ans[0])

Fixed submission:
S = str(input())
m=0
point=0
for i in S:
    if i == "A" or i == "G" or i == "C" or i == "T":
        point+=1
    else:
        point*=0
    m = max(m, point)
print(m)

Buggy python submission (verdict: Runtime Error):
import re

S=input()
ans = sorted((re.findall("[AGCT]*", S), reverse=True, key=len)
print(ans[0])

Fixed submission:
S = str(input())
m=0
point=0
for i in S:
    if i == "A" or i == "G" or i == "C" or i == "T":
        point+=1
    else:
        point*=0
    m = max(m, point)
print(m)
Buggy python submission (verdict: Time Limit Exceeded):
N, M = map(int, input().split())

A = []
for i in range(N):
    a, b = map(int, input().split())
    A.append([a, b])

A.sort(key=lambda x:x[0])

money = 0
cnt = 0
for i in range(N):
    for j in range(A[i][1]):
        money += A[i][0]
        cnt += 1
        if cnt == M:
            print(money)
            break

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

A = []
for i in range(N):
    a, b = map(int, input().split())
    A.append([a, b])

A.sort(key=lambda x:x[0])

money = 0
cnt = 0
for i in range(N):
    if cnt + A[i][1] < M: 
        money += A[i][0]*A[i][1]
        cnt += A[i][1]
    else: 
        money += A[i][0]*(M-cnt)
        print(money)
        break