Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
def resolve():
    a, b, = int(input())
    ans = max([a + b, a - b, a * b])
    print(ans)


if __name__ == "__main__":
    resolve()


Fixed submission:
def resolve():
    a, b = map(int, input().split())
    ans = max(a + b, a - b, a * b)
    print(ans)


if __name__ == "__main__":
    resolve()

Buggy python submission (verdict: Runtime Error):
def resolve():
    a, b, = int(input())
    ans = max(a + b, a - b, a * b)
    print(ans)


if __name__ == "__main__":
    resolve()


Fixed submission:
def resolve():
    a, b = map(int, input().split())
    ans = max(a + b, a - b, a * b)
    print(ans)


if __name__ == "__main__":
    resolve()
Buggy python submission (verdict: Time Limit Exceeded):
def solve():
    n = int(input())
    people = input()
    return min([people[:i].count("W") + people[i + 1:].count("E") for i in range(n)])


if __name__ == "__main__":
    print(solve())


Fixed submission:
def resolve():
    n = int(input())
    s = input()
    left = [0] * n
    right = [s[1:].count("E")] + [0] * (n - 1)
    ans = [s[1:].count("E")] + [0] * (n - 1)
    for i in range(1, n):
        left[i] = left[i - 1] + (1 if s[i - 1] == "W" else 0)
        right[i] = right[i - 1] + (-1 if s[i] == "E" else 0)
        ans[i] = left[i] + right[i]
    print(min(ans))


if __name__ == "__main__":
    resolve()
Buggy python submission (verdict: Runtime Error):
def resolve():
    a, b, k = list(map(int, input().split()))
    small = list(range(a, b))[:k]
    large = list(range(a, b + 1))[::-1][:k]
    ans = sorted(set(small + large))
    for i in ans:
        print(i)


if __name__ == "__main__":
    resolve()


Fixed submission:
def resolve():
    a, b, k = list(map(int, input().split()))
    s = set()
    for i in range(a, min(a + k, b + 1)):
        s.add(i)
    for i in range(max(a, b - k + 1), b + 1):
        s.add(i)
    for i in sorted(s):
        print(i)


if __name__ == "__main__":
    resolve()
Buggy python submission (verdict: Time Limit Exceeded):
def resolve():
    n = int(input())
    p = list(map(int, input().split()))
    ans = 0
    while any(i + 1 == p[i] for i in range(n)):
        for i in range(n - 1):
            if i + 1 == p[i]:
                p[i], p[i + 1] = p[i + 1], p[i]
                ans += 1
    print(ans)


if __name__ == "__main__":
    resolve()


Fixed submission:
def resolve():
    n = int(input())
    p = list(map(int, input().split()))
    ans = 0
    if p[0] == 1:
        p[0], p[1] = p[1], p[0]
        ans += 1
    if p[n - 1] == n:
        p[n - 2], p[n - 1] = p[n - 1], p[n - 2]
        ans += 1
    for i in range(n - 1):
        if p[i] == i + 1:
            p[i], p[i + 1] = p[i + 1], p[i]
            ans += 1
    print(ans)


if __name__ == "__main__":
    resolve()
Buggy python submission (verdict: Runtime Error):
from math import gcd
from functools import reduce


def resolve():
    n = int(input())
    t = list(int(input()) for _ in range(n))
    res = 1
    for ti in t:
        res = lcm_base(res, ti)
    print(res)


def lcm_base(x, y):
    return x * y // gcd(x, y)


def lcm(numbers):
    return reduce(lcm_base, numbers, 1)


if __name__ == "__main__":
    resolve()


Fixed submission:
from fractions import gcd
from functools import reduce


def resolve():
    n = int(input())
    t = list(int(input()) for _ in range(n))
    res = 1
    for ti in t:
        res = lcm_base(res, ti)
    print(res)


def lcm_base(x, y):
    return x * y // gcd(x, y)


def lcm(numbers):
    return reduce(lcm_base, numbers, 1)


if __name__ == "__main__":
    resolve()

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


def resolve():
    n = int(input())
    t = list(int(input()) for _ in range(n))
    print(lcm(t))


def lcm_base(x, y):
    return x * y // gcd(x, y)


def lcm(numbers):
    return reduce(lcm_base, numbers, 1)


if __name__ == "__main__":
    resolve()


Fixed submission:
from fractions import gcd
from functools import reduce


def resolve():
    n = int(input())
    t = list(int(input()) for _ in range(n))
    res = 1
    for ti in t:
        res = lcm_base(res, ti)
    print(res)


def lcm_base(x, y):
    return x * y // gcd(x, y)


def lcm(numbers):
    return reduce(lcm_base, numbers, 1)


if __name__ == "__main__":
    resolve()

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


def resolve():
    n = int(input())
    t = list(int(input()) for _ in range(n))
    ans = lcm(t)
    print(ans)


def lcm_base(x, y):
    return x * y // gcd(x, y)


def lcm(numbers):
    return reduce(lcm_base, numbers, 1)


if __name__ == "__main__":
    resolve()


Fixed submission:
from fractions import gcd
from functools import reduce


def resolve():
    n = int(input())
    t = list(int(input()) for _ in range(n))
    res = 1
    for ti in t:
        res = lcm_base(res, ti)
    print(res)


def lcm_base(x, y):
    return x * y // gcd(x, y)


def lcm(numbers):
    return reduce(lcm_base, numbers, 1)


if __name__ == "__main__":
    resolve()
Buggy python submission (verdict: Runtime Error):
import math


def resolve():
    n = int(input())
    print(2 ** int(math.log2(n)))


if __name__ == "__main__":
    resolve()


Fixed submission:
def resolve():
    n = int(input())
    ans = 0
    for i in range(2, n + 1, 2):
        c = 0
        while i % 2 == 0:
            i //= 2
            c += 1
        if c > ans:
            ans = c
    print(2 ** ans)


if __name__ == "__main__":
    resolve()
Buggy python submission (verdict: Time Limit Exceeded):
def solve():
    k, s = map(int, input().split())
    c = 0
    for x in range(k + 1):
        for y in range(k + 1):
            for z in range(k + 1):
                if x + y + z == s:
                    c += 1
    return c


if __name__ == "__main__":
    print(solve())


Fixed submission:
def solve():
    k, s = map(int, input().split())
    c = 0
    for x in range(k + 1):
        for y in range(k + 1):
            if 0 <= s - (x + y) <= k:
                c += 1
    return c


if __name__ == "__main__":
    print(solve())
Buggy python submission (verdict: Runtime Error):
def resolve():
    a, b, h = map(int, input().split())
    print((a + b) * h // 2)


if __name__ == "__main__":
    resolve()


Fixed submission:
def resolve():
    a = int(input())
    b = int(input())
    h = int(input())
    print((a + b) * h // 2)


if __name__ == "__main__":
    resolve()

Buggy python submission (verdict: Runtime Error):
def resolve():
    a, b, h = list(map(int, input().split()))
    print((a + b) * h // 2)


if __name__ == "__main__":
    resolve()


Fixed submission:
def resolve():
    a = int(input())
    b = int(input())
    h = int(input())
    print((a + b) * h // 2)


if __name__ == "__main__":
    resolve()
Buggy python submission (verdict: Runtime Error):
def resolve():
    a = input()
    b = input()
    c = input()
    d = {"a": a, "b": b, "c": c}
    now = d["a"][0]
    d["a"] = d["a"][1:]
    next = d[now][0]
    while True:
        if len(d[next]) == 0:
            print(next.upper())
            return 0
        next = d[next][0]
        d[next] = d[next][1:]


if __name__ == "__main__":
    resolve()


Fixed submission:
def resolve():
    a = list(input())
    b = list(input())
    c = list(input())
    d = {"a": a, "b": b, "c": c}
    now = "a"
    while d[now]:
        now = d[now].pop(0)
    print(now.upper())


if __name__ == "__main__":
    resolve()
Buggy python submission (verdict: Runtime Error):
def resolve():
    n, l = map(int, input().split())
    a = list(map(int, input().split()))
    for i in range(n):
        if a[i] + a[i + 1] >= l:
            last = i
            print("Possible")
            for j in range(last):
                print(i)
            for j in range(last + 1, n):
                print(i)
            print(last)
            return 0
    print("Impossible")
    return 0


if __name__ == "__main__":
    resolve()


Fixed submission:
def resolve():
    n, l = map(int, input().split())
    a = list(map(int, input().split()))
    for i in range(n - 1):
        if a[i] + a[i + 1] >= l:
            print("Possible")
            for j in range(i):
                print(j + 1)
            for j in range(n - 1, i, -1):
                print(j)
            return 0
    print("Impossible")


if __name__ == "__main__":
    resolve()
Buggy python submission (verdict: Runtime Error):
data=input().split()
ans=1
count=0

for i in data:
  if int(i)<=9:
    ans*=int(i)
  if int(i)>9:
    count+=1
    
if count>=1:
  print("-1")
elif cuont==0:
  print(ans)

Fixed submission:
data=input().split()
sum=0

for i  in data:
  if int(i)>=10:
    sum+=1
if sum==0:
  print(int(data[0])*int(data[1]))
else:
  print("-1")
Buggy python submission (verdict: Runtime Error):
data=int(input())
count=0

for i in range(10):
  a=i
  c=data%i
  if c==0:
    b=data//i
    if a<=9 and b<=9 :
    count+=1
if count>=1:
  print("Yes")
else:
  print("No")

Fixed submission:
data=int(input())
sum=0

for i in range(9):
  a=data%(i+1)
  b=data/(i+1)
  if a==0 and b<=9:
    sum+=1
if sum>=1:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
num=int(input())
data=list(input())
 
count=1
for i in range(num-1):
  if data[i]=!data[i+1]:
    count+=1
print(count)


Fixed submission:
num=int(input())
data=list(input())
 
count=1
for i in range(num-1):
  if data[i] is not data[i+1]:
    count+=1
print(count)

Buggy python submission (verdict: Runtime Error):
num=input()
data=list(input())

count=1
for i in range(num-1):
  if data[i]=!data[i+1]:
    count+=1
print(count)


Fixed submission:
num=int(input())
data=list(input())
 
count=1
for i in range(num-1):
  if data[i] is not data[i+1]:
    count+=1
print(count)
Buggy python submission (verdict: Runtime Error):
N = int(input())
res = False
for i in range(N):
  if i * i > N:
    break
  else:
    q = N // i
    if i * q == N and 1 <= i <= 9 and 1 <= q <= 9:
      res = True
      break
print('Yes' if res else 'No')

Fixed submission:
N = int(input())
res = False
for i in range(1, N+1):
  if i * i > N:
    break
  else:
    q = N // i
    if i * q == N and 1 <= i <= 9 and 1 <= q <= 9:
      res = True
      break
print('Yes' if res else 'No')
Buggy python submission (verdict: Runtime Error):
import fractions

def factor(x):
  t = x
  p = [1]
  for i in range(2, -int(-x**0.5//1)+1):
    if x % i == 0:
      p += [i]
      while x % i == 0:
        x /= i
  if len(p) == 1:
    p += t
  return p

A, B = list(map(int, input().split()))
d = fractions.gcd(A, B)
p = factor(d)
print(len(p))

Fixed submission:
import fractions

def factor(x):
  t = x
  p = [1]
  for i in range(2, -int(-x**0.5//1)+1):
    if x % i == 0:
      p += [i]
      while x % i == 0:
        x /= i
  if len(p) == 1 and t != 1:
    p += [t]
  return p

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr


A, B = list(map(int, input().split()))
d = fractions.gcd(A, B)
#p = factor(d)
p = factorization(d)
#print(p)
print(len(p) + (0 if p[0][0] == 1 else 1))
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = map(int, input().split())

mn = 10 ** 9
mx = 0

for i in range(n):
  if a[i] < mn:
    mn = a[i]
    
  if a[i] > mx:
    mx = a[i]

print(mx - mn)

Fixed submission:
n = int(input())
a = [int(i) for i in input().split()]
 
mn = 10 ** 9
mx = 0
 
for i in range(n):
  if a[i] < mn:
    mn = a[i]
    
  if a[i] > mx:
    mx = a[i]
  
print(mx - mn)
Buggy python submission (verdict: Runtime Error):
s=input()
n=int(s)
sn=0
for d in s:
  sn+=int(d)
if n%sn==0:
  Print("Yes")
else:
  print("No")

Fixed submission:
s=input()
n=int(s)
sn=0
for d in s:
  sn+=int(d)
if n%sn==0:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = input()
min_turn = n
for i in range(n):
  turn = 0
  for j in range(n):
    if j < i:
      if s[j] == 'W':
        turn += 1
    elif j > i:
      if s[j] == 'E':
        turn += 1
    if turn == min_turn:
      break
  if turn < min_turn:
    min_turn = turn
print(min_turn)

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

w = []
for i in range(n):
  if s[i] == 'W':
    diff = 1
  else:
    diff = 0
  
  if i == 0:
    w += [diff]
  else:
    w += [w[i - 1] + diff]

min_turns = n
for i in range(n):
  if i == 0:
    turns = n - 1 - (w[n - 1] - w[i])
  elif i == n - 1:
    turns = w[i - 1]
  else:
    turns = w[i - 1] + n - (i + 1) - (w[n - 1] - w[i])
  
  if turns < min_turns:
    min_turns = turns

print(min_turns)
Buggy python submission (verdict: Time Limit Exceeded):
s = input()
k = int(input())

alphabet = "abcdefghijklmnopqrstuvwxyz"
candidates = []

for i in range(len(alphabet)):
  key = alphabet[i]
  count = s.count(key)
  if count > 0:
    index = 0
    for j in range(count):
      index = s.find(key, index)
      for i in range(index, len(s) + 1):
        if not s[index:i] in candidates and len(s[index:i]) > 0 and len(s[index:i]) <= k:
          candidates += [s[index:i]]
      index += 1
  if len(candidates) >= k:
    break

candidates.sort()
print(candidates[k - 1])

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

#alphabet = "abcdefghijklmnopqrstuvwxyz"
candidates = []

for i in range(len(s)):
  for j in range(i + 1, len(s) + 1):
    if not s[i:j] in candidates:
      candidates += [s[i:j]]
    if len(s[i:j]) >= k:
      break

candidates.sort()
print(candidates[k - 1])

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

alphabet = "abcdefghijklmnopqrstuvwxyz"
candidates = []

for i in range(len(alphabet)):
  key = alphabet[i]
  count = s.count(key)
  if count > 0:
    index = 0
    for j in range(count):
      index = s.find(key, index)
      for i in range(index, len(s) + 1):
        if not s[index:i] in candidates and len(s[index:i]) > 0:
          candidates += [s[index:i]]
      index += 1
  if len(candidates) >= k:
    break

candidates.sort()
print(candidates[k - 1])

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

#alphabet = "abcdefghijklmnopqrstuvwxyz"
candidates = []

for i in range(len(s)):
  for j in range(i + 1, len(s) + 1):
    if not s[i:j] in candidates:
      candidates += [s[i:j]]
    if len(s[i:j]) >= k:
      break

candidates.sort()
print(candidates[k - 1])
Buggy python submission (verdict: Time Limit Exceeded):
def comb(n, r):
  result = 1
  
  for i in range(n, n - r, -1):
    result *= i
  for i in range(r, 1, -1):
    result //= i
  
  return result

n = int(input())
a = list(int(i) for i in input().split())

a.sort()
a.reverse()
max = 0

for i in range(1, n):
  c = comb(a[0], a[i])
  if c > max:
    max = c
  else:
    i -= 1
    break

print(a[0], a[i])


Fixed submission:
n = int(input())
a = list(int(i) for i in input().split())

a.sort()
a.reverse()
max = 0

for i in range(1, n):
  m = min(a[0] - a[i], a[i])
  #c = comb(a[0], a[i])
  if m > max:
    max = m
  else:
    i -= 1
    break

if i == 0:
  print(a[0], a[1])
else:
  print(a[0], a[i])
Buggy python submission (verdict: Time Limit Exceeded):
a, b, k = (int(i) for i in input().split())  

for i in range(a, b + 1):
  if i < a + k or i > b - k:
    print(i)

Fixed submission:
a, b, k = (int(i) for i in input().split())  

for i in range(a, min(a + k, b + 1)):
    print(i)
    
for i in range(max(a + k, b - k + 1), b + 1):
    print(i)
Buggy python submission (verdict: Time Limit Exceeded):
q = int(input())
a = []
b = []
for i in range(q):
  c = [int(i) for i in input().split()]
  a += [c[0]]
  b += [c[1]]

for i in range(q):
  prod = a[i] * b[i]
  cnt = 0
  used = prod
  for j in range(1, prod):
    if j == a[i]:
      continue
    
    upper_limit = prod // j
    for k in range(min(used - 1, upper_limit), 0, -1):
      if k == b[i] or j * k >= prod:
        continue
      else:
        used = k
        cnt += 1
        break
  print(cnt)

Fixed submission:
import math

q = int(input())
a = []
b = []
for i in range(q):
  c = [int(i) for i in input().split()]
  a += [c[0]]
  b += [c[1]]

for i in range(q):
  prod = a[i] * b[i]
  sqrt = int(math.sqrt(prod))
  cnt = 2 * sqrt

  if a[i] == b[i]:
    cnt -= 2
  else:
    if sqrt * sqrt == prod:
      cnt -= 2
    elif prod // sqrt == sqrt:
      cnt -= 1
    elif prod // sqrt == sqrt + 1 and prod // sqrt * sqrt == prod:
      cnt -= 1
    cnt -= 1
  
  print(cnt)
Buggy python submission (verdict: Time Limit Exceeded):
k, s = map(int, input().split())
res = 0
for x in range(k+1):
  for y in range(k+1):
    for z in range(k+1):
      if x + y + z == s:
        res += 1
print(res)

Fixed submission:
k, s = map(int, input().split())
res = 0
for x in range(k+1):
  if 3 * x == s:
    res += 1
for x in range(k+1):
  for y in range(k+1):
    if x == y:
      continue
    if 2 * x + y == s:
      res += 3
for x in range(k+1):
  for y in range(x+1, k+1):
    d = s - x - y
    if d > y and d <= k:
      res += 6

print(res)
Buggy python submission (verdict: Runtime Error):
import numpy as np
import math
 

xyi = map(int,input().split())
xy = np.array(list(xyi))

x = xy[0]
y = xy[1]
n = 2 * x - y
m = -x + 2 *y

if not n%3 == 0:
    print(0)
else:
    n = int(n/3)
    m = int(m/3)
    cmb = math.factorial(n+m)//math.factorial(n)
    ans = cmb % (10**9 +7)
    print(ans)

Fixed submission:
import numpy as np
 
def calucurate_circle(r):
    S = np.pi * r ** 2
    return S
 
def mulitipulicity(r):
    n = r**2
    n = int(n)
    return n

r = float(input())
print(mulitipulicity(r))
Buggy python submission (verdict: Runtime Error):
def moji_hanbetsu(S,N):
    if N % 2 == 1:
        ans = "no"
    else:
        n = int(N/2)
        s1 = S[0:n]
        s2 = S[-n:]
        if s1 == s2:
            ans="yes"
        else:
            ans ="no"
    return ans
 
N,S = input()

Fixed submission:
N = int(input())
S = input()

if (N % 2) == 1:
    ans = "No"
else:
    n = int(N/2)
    s1 = S[0:n]
    s2 = S[-n:]
    if s1 == s2:
        ans="Yes"
    else:
        ans ="No"
print(ans)
Buggy python submission (verdict: Runtime Error):
N,L = map(int, input().split())
S = 26*[""] 
for i in range(N):
    S[i] = input()

S.sort()

str = ""

for s in S:
    str += s

print(str)


Fixed submission:
N,L = map(int, input().split())
S = N*[""] 
for i in range(N):
    S[i] = input()

S.sort()

str = ""

for s in S:
    str += s

print(str)
Buggy python submission (verdict: Runtime Error):
N = input()
ans = pow(N, 3)
print(ans)


Fixed submission:
N = input()
ans = pow(N, 3)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
h=list(map(int,input().split()))
d=1
mx=0
i=1
while i<n:
  if(h[i]>h[i-1]):
    if(d>mx):
      mx=d
    d=1
  else:
    d+=1
print(mx)

Fixed submission:
n=int(input())
h=list(map(int,input().split()))
d=0
mx=0
i=1
while i<n:
    if(h[i]>h[i-1]):
        if(d>mx):
            mx=d
        d=0
    else:
        d+=1
    i+=1
print(max(mx,d))
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input())
print(max(a+b,a-b,a*b))

Fixed submission:
a,b=map(int,input().split())
print(max(a+b,a-b,a*b))
Buggy python submission (verdict: Runtime Error):
n=int(input())
s=input()
sub=(n/2)
if count(s[0:sub])==2:
  print(Yes)
else:
  print(No)

Fixed submission:
n=int(input())
s=input()
sub=s[0:(n//2)]
if n==1 or n%2!=0:
    print("No")
elif s.count(sub)==2:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
import numpy as np

def main():
	A, B, X = [int(x) for x in input().split()]

	if (A * A * B) / 2.0 >= X:
		y = (2 * X) / (A * B)
		R = np.arctan(y / B)
		print(90 - np.rad2deg(R))
	else:
		_x = (A * A * B) - X
		y = (2 * _x) / (A * A)
		R = np.arctan(A / y)
		print(90 - np.rad2deg(R))
	
if __name__ == "__main__":
	main()


Fixed submission:
import numpy as np

def main():
	A, B, X = [int(x) for x in input().split()]

	if (A * A * B) / 2.0 >= X:
		y = (2 * X) / (A * B)
		R = np.arctan(y / B)
		print(90 - np.rad2deg(R))
	else:
		_x = (A * A * B) - X
		y = (2 * _x) / (A * A)
		try:
			R = np.arctan(A / y)
			print(90 - np.rad2deg(R))
		except:
			print(0.000000000)
		
	
if __name__ == "__main__":
	main()
Buggy python submission (verdict: Time Limit Exceeded):

def main():
	N = int(input()) 
	A = [int(f) for f in input().split()]
	B = [int(f) for f in input().split()]
	
	m = 0
	for i in range(N):
		while A[i] > 0 and B[i] > 0:
			A[i] -= 1
			B[i] -= 1
			m += 1
		if B[i] > 0:
			while A[i+1] > 0 and B[i] > 0:
				A[i+1] -= 1
				B[i] -= 1
				m += 1
	
	print(m)

if __name__ == "__main__":
	main()

Fixed submission:

def main():
	N = int(input()) 
	A = [int(f) for f in input().split()]
	B = [int(f) for f in input().split()]
	
	m = 0
	for i in range(N):
		A[i] = A[i] - B[i]
		m += B[i]
		if A[i] < 0:
			B[i] = -A[i]
			m += A[i]
			A[i] = 0
		else:
			continue
		if B[i] > 0:
			A[i+1] = A[i+1] - B[i]
			m += B[i]
			if A[i+1] < 0:
				B[i] = -A[i+1]
				m += A[i+1]
				A[i+1] = 0
	
	print(m)

if __name__ == "__main__":
	main()
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np


def main():
	#N, D = [int(x) for x in input().split()]
	N = int(input())
	
	lst = []
	for i in range(N):
		lst.append(int(input()))

	a = np.array(lst)
	
	for i in range(N):
		mask = [True] * N
		mask[i] = False
		mask = np.array(mask)
		_a = a[mask]
		print(np.max(_a))

if __name__ == "__main__":
	main()


Fixed submission:
import numpy as np


def main():
	#N, D = [int(x) for x in input().split()]
	N = int(input())
	
	max_num = 0
	sub_max = 0
	index = 0
	for i in range(N):
		num = int(input())
		if num > max_num:
			index = i
			sub_max = max_num
			max_num = num
		elif num > sub_max:
			sub_max = num

	for i in range(N):
		if i == index:
			print(sub_max)
		else:
			print(max_num)

if __name__ == "__main__":
	main()
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np


def main():
	L, R = [int(x) for x in input().split()]
	tmp_min = np.inf
	for i in range(L, R+1):
		for j in range(i+1, R+1):
			if (i * j) % 2019 < tmp_min:
				tmp_min = (i * j) % 2019
	print(tmp_min)

if __name__ == "__main__":
	main()


Fixed submission:
import numpy as np


def main():
	L, R = [int(x) for x in input().split()]
	tmp_min = np.inf
	for i in range(L, R+1):
		for j in range(i+1, R+1):
			if (i * j) % 2019 < tmp_min:
				tmp_min = (i * j) % 2019
				if tmp_min == 0:
					print(tmp_min)
					exit()
	print(tmp_min)

if __name__ == "__main__":
	main()
Buggy python submission (verdict: Runtime Error):
a = int(input())
b = input()
count =int(a/2)
bf = b[:count]
bb = b[count:]
if a %2==0 && bf == bb:
    print('yes')
else:
    print('no')

Fixed submission:
a = int(input())
b = a**2
print(b)

Buggy python submission (verdict: Runtime Error):
r=int(input())
aera=r**2
print(area)


Fixed submission:
r=int(input())
print(r**2)

Buggy python submission (verdict: Runtime Error):
def area(r):
  area= r**2
  return area
print(area(r))


Fixed submission:
r=int(input())
print(r**2)