Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
import fractions
N = int(input())
T = list(map(int, input().split()))
lcm = T[0]
ans = 0
MOD = 1000000007
for i in range(1, N):
  lcm = lcm * T[i] // fractions.gcd(lcm, T[i])
for x in T:
  ans = (ans + lcm // x) % MOD
print(ans)

Fixed submission:
import fractions
N = int(input())
T = list(map(int, input().split()))
lcm = T[0]
ans = 0
MOD = 1000000007
for i in range(1, N):
  lcm = lcm * T[i] // fractions.gcd(lcm, T[i])
for x in T:
  ans += lcm // x
print(ans % MOD)

Buggy python submission (verdict: Time Limit Exceeded):
def gcd(a, b):
  if b == 0:
    return a
  else:
    return gcd(b, a % b)

N = int(input())
T = list(map(int, input().split()))
lcm = T[0]
ans = 0
MOD = 1000000007
for i in range(1, N):
  lcm = (lcm * T[i]) // gcd(lcm, T[i])
for i in range(N):
  ans = (ans + lcm // T[i]) % MOD
print(ans)

Fixed submission:
import fractions
N = int(input())
T = list(map(int, input().split()))
lcm = T[0]
ans = 0
MOD = 1000000007
for i in range(1, N):
  lcm = lcm * T[i] // fractions.gcd(lcm, T[i])
for x in T:
  ans += lcm // x
print(ans % MOD)

Buggy python submission (verdict: Time Limit Exceeded):
import fractions
N = int(input())
T = list(map(int, input().split()))
lcm = T[0]
ans = 0
MOD = 1000000007
for i in range(1, N):
  lcm = lcm * T[i] // fractions.gcd(lcm, T[i])
for i in range(N):
  ans = (ans + lcm//T[i]) % MOD
print(ans)

Fixed submission:
import fractions
N = int(input())
T = list(map(int, input().split()))
lcm = T[0]
ans = 0
MOD = 1000000007
for i in range(1, N):
  lcm = lcm * T[i] // fractions.gcd(lcm, T[i])
for x in T:
  ans += lcm // x
print(ans % MOD)

Buggy python submission (verdict: Time Limit Exceeded):
import fractions
N = int(input())
T = list(map(int, input().split()))
lcm = T[0]
ans = 0
MOD = 1000000007
for i in range(1, N):
  lcm = lcm * T[i] // fractions.gcd(lcm, T[i])
for i in range(N):
  ans = (ans + lcm//T[i]) % MOD
print(ans)

Fixed submission:
import fractions
N = int(input())
T = list(map(int, input().split()))
lcm = T[0]
ans = 0
MOD = 1000000007
for i in range(1, N):
  lcm = lcm * T[i] // fractions.gcd(lcm, T[i])
for x in T:
  ans += lcm // x
print(ans % MOD)
Buggy python submission (verdict: Runtime Error):
import math
N = int(input())
X = []
for _ in range(N):
  x, l = map(int,input().split())
  X.append([x+l, x-l])
sorted_X = sorted(X, key=lambda x:(x[1], x[2]))
ans = 1
cnt = sorted_X[0][0]
for i in range(N):
  if sorted_X[i][1] >= cnt:
    ans += 1
    cnt = sorted_X[i][0]
print(ans)

Fixed submission:
import math
N = int(input())
X = []
for _ in range(N):
  x, l = map(int,input().split())
  X.append([x+l, x-l])
sorted_X = sorted(X, key=lambda x:(x[0], x[1]))
ans = 1
cnt = sorted_X[0][0]
for i in range(N):
  if sorted_X[i][1] >= cnt:
    ans += 1
    cnt = sorted_X[i][0]
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import math
N = int(input())
X = []
for _ in range(N):
  x, l = map(int,input().split())
  X.append([x+l, x, l])
sorted_X = sorted(X, key=lambda x:(x[1], x[2]))
ans = 1
for i in range(N-1):
  temp = 1
  cnt = sorted_X[i][0]
  for j in range(i+1,N):
    if sorted_X[j][1] - sorted_X[j][2] >= cnt:
      temp += 1
      cnt = sorted_X[j][0]
  if temp > ans:
    ans = temp
print(ans)

Fixed submission:
import math
N = int(input())
X = []
for _ in range(N):
  x, l = map(int,input().split())
  X.append([x+l, x-l])
sorted_X = sorted(X, key=lambda x:(x[0], x[1]))
ans = 1
cnt = sorted_X[0][0]
for i in range(N):
  if sorted_X[i][1] >= cnt:
    ans += 1
    cnt = sorted_X[i][0]
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
from math import factorial
N = int(input())
C = list(map(int, input().split()))
C.sort()
MOD = 1000000007
ans = 0
if N == 1:
  ans = C[0]*2 % MOD
else:
  for i in range(N):
    for j in range(i,N):
      ans = (ans + 2**(i+N)*(N-j)*C[i]*factorial(N-i-1)//(factorial(N-j-1)*factorial(j-i))) % MOD

print(ans)

Fixed submission:
n = int(input())
c = list(map(int, input().split()))
c.sort()
MOD = 1000000007
ans = 0
P = pow(4, n-1, MOD)
if n == 1:
  ans = c[0]*2 % MOD
else:
  for i in range(n):
    ans += P*c[i]*(n+1-i)
    ans %= MOD
 
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import math
N, M, V, P = map(int, input().split())
A_ = list(map(int, input().split()))
A = sorted(A_)
temp = 0
for i in range(N):
  points = V - P - i
  if points < 0:
    points = 0
  requires = 0
  for j in range(i+1, N-P):
    requires += A[N-P] - A[j]
  kabe = N - P - i
  if kabe == 0:
    temp = i
    break
  else:
    wall = points * M - requires
    if wall < 0:
      wall = 0
    wall_2 = math.ceil(wall / kabe)
    wall_3 = A[N-P] + wall_2
    i_points = A[i] + M
    if i_points >= wall_3:
      temp = i
      break
print(N - temp)

Fixed submission:
import math
N, M, V, P = map(int, input().split())
A_ = list(map(int, input().split()))
A = sorted(A_)
temp = 0
requires = 0
for i in range(N-P):
  requires += A[N-P] - A[i]
for i in range(N):
  points = V - P - i
  if points < 0:
    points = 0
  requires -= A[N-P] - A[i]
  kabe = N - P - i
  if kabe == 0:
    temp = i
    break
  else:
    wall = points * M - requires
    if wall < 0:
      wall = 0
    wall_2 = math.ceil(wall / kabe)
    wall_3 = A[N-P] + wall_2
    i_points = A[i] + M
    if i_points >= wall_3:
      temp = i
      break
print(N - temp)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))
mod = 1000000007
ans = 1
l = []
for i in range(n):
  if a[i] == 0:
    l.append(0)
    ans = ans*(4-len(l))%mod
  else:
    id = 0
    count = 0
    for j in range(len(l)):
      if l[j] == a[i] - 1:
        count += 1
        id = j
    ans = (ans*count)%mod
    l[id] = a[i]
  if ans == 0:
    break
print(ans)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
mod = 1000000007
ans = 1
l = []
for i in range(n):
  if a[i] == 0:
    l.append(0)
    ans = ans*(4-len(l))%mod
  else:
    id = -1
    count = 0
    for j in range(len(l)):
      if l[j] == a[i] - 1:
        count += 1
        id = j
    if id == -1:
      ans = 0
      break
    ans = (ans*count)%mod
    l[id] = a[i]
  if ans == 0:
    break
print(ans%mod)

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))
mod = 1000000007
ans = 1
l = []
for i in range(n):
  if a[i] == 0:
    l.append(0)
    ans = ans*(4-len(l))%mod
  else:
    id = 0
    count = 0
    for j in range(len(l)):
      if l[j] == a[i] - 1:
        count += 1
        id = j
    ans = (ans*count)%mod
    l[id] = a[i]
print(ans)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
mod = 1000000007
ans = 1
l = []
for i in range(n):
  if a[i] == 0:
    l.append(0)
    ans = ans*(4-len(l))%mod
  else:
    id = -1
    count = 0
    for j in range(len(l)):
      if l[j] == a[i] - 1:
        count += 1
        id = j
    if id == -1:
      ans = 0
      break
    ans = (ans*count)%mod
    l[id] = a[i]
  if ans == 0:
    break
print(ans%mod)
Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int, input().split())
s = input()

def goal(a):
  if s[a] == "1":
    return -1
  position = a
  cnt1 = 0
  cnt2 = 0
  count = 0
  for i in range(a + 1, n):
    cnt1 += 1
    if s[i] == "0":
      cnt2 = i - position
    if cnt1 == m:
      if cnt2 == 0:
        count = -1
        break
      else:
        position += cnt2
        count += 1
        cnt1 = i - position
  if count == -1:
    return -1
  else:
    count += 1
    return count
  
A = []
B = [0]
C = []
for i in range(n):
  A.append(goal(i))
cnt = A[0]
for i in range(1,n):
  if A[i] == cnt - 1:
    B.append(i)
  if A[i] != -1:
    cnt = A[i]
B.append(n)
for i in range(len(B) - 1):
  C.append(B[i + 1] - B[i])
if goal(0) == -1:
  print(-1)
else:
  print(" ".join(map(str, C)))

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

l = []
cur = n

while cur > 0:
  position = cur
  cur = max(0, cur - m)
  while s[cur] == "1":
    cur += 1
  if cur == position:
    print(-1)
    exit(0)
  l.append(str(position - cur))
l.reverse()
print(" ".join(l))
Buggy python submission (verdict: Time Limit Exceeded):
from math import floor
from bisect import insort_left
n, m = map(int, input().split())
l = list(map(int, input().split()))
l.sort()
for i in range(m):
  a = l.pop(-1)
  a /= 2
  insort_left(l, a)
ans = 0
for i in range(n):
  ans += floor(l[i])
print(ans)

Fixed submission:
import heapq
n, m = map(int, input().split())
l = list(map(int, input().split()))
l = [-x for x in l]
heapq.heapify(l)
for i in range(m):
  a = heapq.heappop(l)
  heapq.heappush(l, a / 2)
print(-sum(int(x) for x in l))

Buggy python submission (verdict: Time Limit Exceeded):
from math import floor
from bisect import bisect_left
n, m = map(int, input().split())
l = list(map(int, input().split()))
l.sort()
for i in range(m):
  a = l.pop(-1)
  a /= 2
  index = bisect_left(l, a)
  l.insert(index, a)
ans = 0
for i in range(n):
  ans += floor(l[i])
print(ans)

Fixed submission:
import heapq
n, m = map(int, input().split())
l = list(map(int, input().split()))
l = [-x for x in l]
heapq.heapify(l)
for i in range(m):
  a = heapq.heappop(l)
  heapq.heappush(l, a / 2)
print(-sum(int(x) for x in l))
Buggy python submission (verdict: Time Limit Exceeded):
from bisect import bisect_left
n = int(input())
x = [int(input())]
for _ in range(n-1):
  a = int(input())
  if a <= x[0]:
    x.insert(0, a)
  else:
    index = bisect_left(x, a)-1
    x[index] = a
print(len(x))

Fixed submission:
from bisect import bisect_right
n = int(input())
a = int(input())
x = [a * (-1)]
for _ in range(n-1):
  a = int(input()) * (-1)
  if a >= x[-1]:
    x.append(a)
  else:
    index = bisect_right(x, a)
    x[index] = a
print(len(x))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
l = [0 for i in range(n)]
for i in range(n):
    if i%2 == 0:
        l[i] = 2*(sum(a)//2 - sum(a[i+1::2]) - sum(a[:i:2]))
    else:
        l[i] = 2*(sum(a)//2 - sum(a[i+1::2]) - sum(a[1:i:2]))
print(" ".join(map(str, l)))

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
ans = []
a_sum = sum(a)//2
a2 = a + a
l = [0 for i in range(2*n)]
for i in range(2*n):
    if i == 0:
        l[i] = 0
    elif i == 1:
        l[i] = a2[0]
    else:
        l[i] = l[i-2] + a2[i-1]
for i in range(n):
    ans.append(2*(a_sum - l[i+n-1] + l[i]))
print(" ".join(map(str, ans)))
Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
s = input()
if s[k - 1] == "A":
    s = s[:k - 1] + "a" + s[k:]
elif s[k - 1] == "B":
    s[k - 1] = s[:k - 1] + "b" + s[k:]
else:
    s[k - 1] = s[:k - 1] + "c" + s[k:]
print(s)

Fixed submission:
n, k = map(int, input().split())
s = input()
print(s[:k - 1] + s[k - 1].lower() + s[k:])
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
count = 0
for i in range(0,n.2):
  if a[i] % 2 == 1:
    count += 1
print(count)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
count = 0
for i in range(0,n,2):
  if a[i] % 2 == 1:
    count += 1
print(count)
Buggy python submission (verdict: Runtime Error):
s = input()
t = input()
for i in renge(len(s))
  if s[i] == t[i]:
    continue
  else:
    print("No")
  
  if i == (len(s)-1):
    print("Yes")

Fixed submission:
s = input()
t = input()
if s == t[:len(s):]:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
k = int(input())
a,b = map(int, inupt().split())
for i in range(a,b+1):
  if i % k == 0:
    print("OK")
  elif i == b:
    print("NG")
    break


Fixed submission:
k = int(input())
a,b = map(int, input().split())
for i in range(a,b+1):
  if i % k == 0:
    print("OK")
    break
  elif i == b:
    print("NG")
    break
Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(int, input().split())
over = n+1
while over > n:
  over = n
  n = abs(n-k)
print(over)

Fixed submission:
n,k = map(int, input().split())
if n % k == 0:
  print(0)
elif n % k <= k - (n % k):
  print(n % k)
else:
  print(k - (n % k))
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input(),split()))
sa = set(a)
if len(a) == len(sa):
  print("YES")
else:
  print("NO")

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
sa = set(a)
if len(a) == len(sa):
  print("YES")
else:
  print("NO")

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
yn = ["YES","NO"]
flag = 0
for i in range(n-1):
  for j in range(i+1, n):
    if a[i] == a[j]: 
      flag = 1
print(yn[flag])

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
sa = set(a)
if len(a) == len(sa):
  print("YES")
else:
  print("NO")

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map, int(input().split()))
yn = ["YES","NO"]
flag = 0
for i in range(n-1):
  for j in range(i+1, n):
    if i == j: 
      flag = 1
print(yn[flag])

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
sa = set(a)
if len(a) == len(sa):
  print("YES")
else:
  print("NO")
Buggy python submission (verdict: Runtime Error):
n = int(input())
l = list(input().split())
s = ""
for i in range(n):
  s += (l[0][n] + l[1][n])
print(s)

Fixed submission:
n = int(input())
l = list(input().split())
s = ""
for i in range(n):
  s += (l[0][i] + l[1][i])
print(s)

Buggy python submission (verdict: Runtime Error):
n = int(input())
l = list(input().split())
for i in range(n):
  print(l[0][n] + l[1][n])

Fixed submission:
n = int(input())
l = list(input().split())
s = ""
for i in range(n):
  s += (l[0][i] + l[1][i])
print(s)
Buggy python submission (verdict: Runtime Error):
n,k = map(int, input().split())
h = list(map(int, input().split()))
count = 0
for i in range(n):
  if h[n] >= k:
    count += 1
print(count)

Fixed submission:
n,k = map(int, input().split())
h = list(map(int, input().split()))
count = 0
for i in range(n):
  if h[i] >= k:
    count += 1
print(count)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
ans = [0] * n
for i in range(n):
       ans[a[i]-1] = i+1
for j in range(len(ans):
       print(ans[j] , end = " ")

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
ans = [0] * n
for i in range(n):
       ans[a[i]-1] = i+1
for j in range(len(ans)):
       print(ans[j] , end = " ")

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
ans = [0 for in range(n)]
for i in range(n):
       ans[a[i]-1] = i+1
for j in range(len(ans):
       print(ans[j] , end = " ")

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
ans = [0] * n
for i in range(n):
       ans[a[i]-1] = i+1
for j in range(len(ans)):
       print(ans[j] , end = " ")

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
ans = [0 for in range(n)]
for i in range(n):
       ans[a[i]-1] = i+1
for j in range(len(ans):
       print(ans[i] , end = " ")

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
ans = [0] * n
for i in range(n):
       ans[a[i]-1] = i+1
for j in range(len(ans)):
       print(ans[j] , end = " ")

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
ans = [0 for in range(n)
for i in range(n):
       ans[a[i]-1] = i+1
for j in range(len(ans):
       print(ans[i] , end = " ")

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
ans = [0] * n
for i in range(n):
       ans[a[i]-1] = i+1
for j in range(len(ans)):
       print(ans[j] , end = " ")
Buggy python submission (verdict: Runtime Error):
n = int(input())
pirnt(n**3)

Fixed submission:
n = int(input())
print(n**3)
Buggy python submission (verdict: Runtime Error):
a,b = map(int, input().split())
l = []
l.append(a+b)
l.append(a-b)
l.append(a*b)
print(max(a))

Fixed submission:
a, b = map(int, input().split())
num = []
num.append(a+b)
num.append(a-b)
num.append(a*b)
print(max(num))

Buggy python submission (verdict: Runtime Error):
a,b = map(int, input().split())
l = []
l.append(a+b)
l.append(a-b)
l.appned(a*b)
print(max(a))

Fixed submission:
a, b = map(int, input().split())
num = []
num.append(a+b)
num.append(a-b)
num.append(a*b)
print(max(num))
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = [0 for n in range(n)]
for i in range(n):
  a[i] = int(input())
a_max = max(a)
for j in range(n):
  if a[j] != a_max:
    print(a_max)
  else:
    a.sort()
    a.reverse()
    print(a[1])

Fixed submission:
r = int(input())
menseki = 3 * r ** 2
print(menseki)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = [0 for n in range(n)]
for i in range(n):
  a[i] = int(input())
a_max = max(a)
for j in range(n):
  if a[j] != a_max:
    print(a_max)
  else:
    a.sort()
    a.reverse()
    print(a[1])

Fixed submission:
n = int(input())
a = [0 for n in range(n)]
for i in range(n):
  a[i] = int(input())
a_max = max(a)
b = sorted(a)
a_second = b[n-2]
for j in range(n):
  if a[j] != a_max:
    print(a_max)
  else:
    print(a_second)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = []
for i in range(n):
  a.append(int(input()))
a_max = max(a)
for j in range(n):
  if a[j] != a_max:
    print(a_max)
  else:
    a.sort()
    a.reverse()
    print(a[1])

Fixed submission:
n = int(input())
a = [0 for n in range(n)]
for i in range(n):
  a[i] = int(input())
a_max = max(a)
b = sorted(a)
a_second = b[n-2]
for j in range(n):
  if a[j] != a_max:
    print(a_max)
  else:
    print(a_second)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = []
for i in range(n):
  a.append(int(input()))
  a_max = max(a)
for j in range(n):
  if a[j] != a_max:
    print(a_max)
  else:
    b = sorted(a)
    print(b[n-2])

Fixed submission:
n = int(input())
a = [0 for n in range(n)]
for i in range(n):
  a[i] = int(input())
a_max = max(a)
b = sorted(a)
a_second = b[n-2]
for j in range(n):
  if a[j] != a_max:
    print(a_max)
  else:
    print(a_second)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = []
for i in range(n):
  a.append(int(input()))
a_max = max(a)
for j in range(n):
  if a[j] != a_max:
    print(a_max)
  else:
    a.sort()
    a.reverse()
    print(a[1])

Fixed submission:
n = int(input())
a = [0 for n in range(n)]
for i in range(n):
  a[i] = int(input())
a_max = max(a)
b = sorted(a)
a_second = b[n-2]
for j in range(n):
  if a[j] != a_max:
    print(a_max)
  else:
    print(a_second)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = []
for i in range(n):
  a.append(int(input()))
  a_max = max(a)
for j in range(n):
  if a[j] != a_max:
    print(a_max)
  else:
    a.sort()
    a.reverse()
    print(a[1])

Fixed submission:
n = int(input())
a = [0 for n in range(n)]
for i in range(n):
  a[i] = int(input())
a_max = max(a)
b = sorted(a)
a_second = b[n-2]
for j in range(n):
  if a[j] != a_max:
    print(a_max)
  else:
    print(a_second)
Buggy python submission (verdict: Runtime Error):
ma = 0
mi = 123
for i in range(5):
  x = input()
  if ma < x:
    ma = x
  elif mi > x:
    mi = x
if ma - mi > input():
  print("Yay!")
else:
  print(":(")

Fixed submission:
a = int(input())
ma = a
mi = a
for i in range(4):
  x = int(input())
  if ma < x:
    ma = x
  elif mi > x:
    mi = x
if ma - mi <= int(input()):
  print("Yay!")
else:
  print(":(")
Buggy python submission (verdict: Runtime Error):
l =[]
s = []
for i in range(4):
  l.appned(int(input()))
if l[0] <= l[1]:
  s.appned(l[0])
else:
  s.append(l[1])
if l[2] <= l[3]:
  s.appned(l[2])
else:
  s.appned(l[3])
print(sum(s))

Fixed submission:
l =[]
s = []
for i in range(4):
  l.append(int(input()))
if l[0] <= l[1]:
  s.append(l[0])
else:
  s.append(l[1])
if l[2] <= l[3]:
  s.append(l[2])
else:
  s.append(l[3])
print(sum(s))
Buggy python submission (verdict: Runtime Error):
print(int(input() // 3)

Fixed submission:
print(int(input()) // 3)
Buggy python submission (verdict: Runtime Error):
s = input()
s[3] = "8"
print(s)

Fixed submission:
s = list(input())
s[3] = "8"
x = ""
for i in range(len(s)):
  x += s[i]
print(x)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = map(int, input().split())
print(max(a)-min(a))

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
print(max(a)-min(a))

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = map(int, input()split())
print(max(a)-min(a))

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
print(max(a)-min(a))
Buggy python submission (verdict: Runtime Error):
a = [1,3,5,7,8,10,12]
b = [4,6,9,11]
x,y = map(int, input().split())
if (x in a and y in a) or (x in b and y in b):

Fixed submission:
a = [1,3,5,7,8,10,12]
b = [4,6,9,11]
x,y = map(int, input().split())
if (x in a and y in a) or (x in b and y in b):
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
a,b = map(int input().split())
if a+b >= 24:
  print(a+b-24)
else:
  print(a+b)

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

Fixed submission:
a = list(input().split())
print(a[0][0] + a[1][0] + a[2][0])
Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())
h = int(input())
print((a+B)*h//2)

Fixed submission:
print((int(input())+int(input()))*int(input())//2)
Buggy python submission (verdict: Runtime Error):
s, t = input().split()
s = list(s)
s.sort()
t = list(t)
t.sort(reverse = True)
if t>s:
    print('Yes')
else:
    print('No')

Fixed submission:
s = input()
t = input()
s = list(s)
s.sort()
t = list(t)
t.sort(reverse = True)
if t>s:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
a = list(map(int, input().split()))
mod = 10**9 +7
ans = 0

for i in range(len(a)-1):
    ans +=a[i]*(sum(a[i+1:len(a)]))
print(ans%mod)

Fixed submission:
N = int(input())
a = list(map(int, input().split()))
a.reverse()
mod = 10**9 +7
ans = 0
S=[0]
for i in range(0,N):
    S.append(S[i]+a[i])
ans = 0
for j in range(len(a)):
    ans +=(a[j]*S[j])
print(ans%mod)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
ans = 1
for i in A:
    ans *=i
print(ans if ans <= 10**18 else -1)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
ans = 1
if 0 in A:
    print(0)
    exit()
for i in A:
    ans *=i
    if ans >10**18:
        print(-1)
        exit()
print(ans)