Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
N, T = map(int,input().split())
ans = float("inf")

for i in range(N):
    c,t = map(int,input().split())
    if t <= T:
        ans = min(ans,c)

if ans == float("inf"):
    print("TLE")
else:
    print(ans)


Fixed submission:
N = int(input())
if N == 1:
    print("Hello World")
elif N == 2:
    A = int(input())
    B = int(input())
    print(A + B)

Buggy python submission (verdict: Runtime Error):
N, T = map(int,raw_input().split())
ans = float("inf")

for i in range(N):
    c,t = map(int,input(),split())
    if t <= T:
        ans = min(num,c)

if ans == float("inf"):
    print("TLE")
else:
    print(ans)


Fixed submission:
N = int(input())
if N == 1:
    print("Hello World")
elif N == 2:
    A = int(input())
    B = int(input())
    print(A + B)

Buggy python submission (verdict: Runtime Error):
N, T = map(int,input().split())
ans = float("inf")

for i in range(0,N):
    c,t = map(int,input(),split())
    if t <= T:
        ans = min(num,c)

if ans == float("inf"):
    print("TLE")
else:
    print(ans)


Fixed submission:
N = int(input())
if N == 1:
    print("Hello World")
elif N == 2:
    A = int(input())
    B = int(input())
    print(A + B)

Buggy python submission (verdict: Runtime Error):
if N == 1:
    print("Hello World")
elif N == 2:
    print(A + B)


Fixed submission:
N = int(input())
if N == 1:
    print("Hello World")
elif N == 2:
    A = int(input())
    B = int(input())
    print(A + B)

Buggy python submission (verdict: Runtime Error):
if N = 1:
  print("Hello Wowld")
elif N = 2:
  print A + B
else:
  exit if


Fixed submission:
N = int(input())
if N == 1:
    print("Hello World")
elif N == 2:
    A = int(input())
    B = int(input())
    print(A + B)
Buggy python submission (verdict: Runtime Error):
N, T = map(int,raw_input().split())
ans = float("inf")

for i in range(N):
    c,t = map(int,input().split())
    if t <= T:
        ans = min(ans,c)

if ans == float("inf"):
    print("TLE")
else:
    print(ans)


Fixed submission:
N, T = map(int,input().split())
ans = float("inf")

for i in range(N):
    c,t = map(int,input().split())
    if t <= T:
        ans = min(ans,c)

if ans == float("inf"):
    print("TLE")
else:
    print(ans)

Buggy python submission (verdict: Runtime Error):
N, T = map(int,input().split())
ans = float("inf")

for i in range(N):
    c,t = map(int,input(),split())
    if t <= T:
        ans = min(ans,c)

if ans == float("inf"):
    print("TLE")
else:
    print(ans)


Fixed submission:
N, T = map(int,input().split())
ans = float("inf")

for i in range(N):
    c,t = map(int,input().split())
    if t <= T:
        ans = min(ans,c)

if ans == float("inf"):
    print("TLE")
else:
    print(ans)

Buggy python submission (verdict: Runtime Error):
N, T = map(int,raw_input().split())
ans = float("inf")

for i in range(N):
    c,t = map(int,input(),split())
    if t <= T:
        ans = min(ans,c)

if ans == float("inf"):
    print("TLE")
else:
    print(ans)


Fixed submission:
N, T = map(int,input().split())
ans = float("inf")

for i in range(N):
    c,t = map(int,input().split())
    if t <= T:
        ans = min(ans,c)

if ans == float("inf"):
    print("TLE")
else:
    print(ans)

Buggy python submission (verdict: Runtime Error):
N, T = map(int,input().split())
ans = float("inf")

for i in range(N):
    c,t = map(int,input(),split())
    if t <= T:
        ans = min(num,c)

if ans == float("inf"):
    print("TLE")
else:
    print(ans)


Fixed submission:
N, T = map(int,input().split())
ans = float("inf")

for i in range(N):
    c,t = map(int,input().split())
    if t <= T:
        ans = min(ans,c)

if ans == float("inf"):
    print("TLE")
else:
    print(ans)

Buggy python submission (verdict: Runtime Error):
N, T = map(int,raw_input().split())
ans = float("inf")

for i in range(N):
    c,t = map(int,input(),split())
    if t <= T:
        ans = min(num,c)

if ans == float("inf"):
    print("TLE")
else:
    print(ans)


Fixed submission:
N, T = map(int,input().split())
ans = float("inf")

for i in range(N):
    c,t = map(int,input().split())
    if t <= T:
        ans = min(ans,c)

if ans == float("inf"):
    print("TLE")
else:
    print(ans)

Buggy python submission (verdict: Runtime Error):
N, T = map(int, raw_input().split())
ans = float("inf")

for i in range(0,N):
    c,t = map(int,input(),split())
    if t <= T:
        ans = min(num,c)

if ans == float("inf"):
    print("TLE")
else:
    print(ans)


Fixed submission:
N, T = map(int,input().split())
ans = float("inf")

for i in range(N):
    c,t = map(int,input().split())
    if t <= T:
        ans = min(ans,c)

if ans == float("inf"):
    print("TLE")
else:
    print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N,M = list(map(int,input().strip().split()))
ans = 1
i = 0

while M//2 >= N+i:
    if M%(N+i) == 0:
        ans = M//(N+i)
        break
    else:
        i += 1

print(ans)

Fixed submission:
import math

N,M = list(map(int,input().strip().split()))
ans = 1
i = 0

def is_prime(num):
    if num < 2:
        return False
    if num == 2 or num == 3 or num == 5:
        return True
    if num % 2 == 0 or num % 3 == 0 or num % 5 == 0:
        return False

    prime = 7
    step = 4
    num_sqrt = math.sqrt(num)
    while prime <= num_sqrt:
        if num % prime == 0:
            return False
        prime += step
        step = 6 - step

    return True

if is_prime(M) == False:
    while M//2 >= N+i:
        if M%(N+i) == 0:
            ans = M//(N+i)
            break
        else:
            i += 1

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N,M = list(map(int,input().strip().split()))
num = N
i = 0

while True:
    if M%(N+i) == 0:
        ans = M//(N+i)
        break
    else:
        i += 1

print(ans)

Fixed submission:
import math

N,M = list(map(int,input().strip().split()))
ans = 1
i = 0

def is_prime(num):
    if num < 2:
        return False
    if num == 2 or num == 3 or num == 5:
        return True
    if num % 2 == 0 or num % 3 == 0 or num % 5 == 0:
        return False

    prime = 7
    step = 4
    num_sqrt = math.sqrt(num)
    while prime <= num_sqrt:
        if num % prime == 0:
            return False
        prime += step
        step = 6 - step

    return True

if is_prime(M) == False:
    while M//2 >= N+i:
        if M%(N+i) == 0:
            ans = M//(N+i)
            break
        else:
            i += 1

print(ans)
Buggy python submission (verdict: Runtime Error):
n = input()
for ans in range(111, 1000, 111):
    if n <= ans:
        break
print(ans)


Fixed submission:
n = input()
n = n.replace("1"," ").replace('9','1').replace(' ','9')
print(n)

Buggy python submission (verdict: Runtime Error):
n = int(input())
n = n.replace("1"," ").replace('9','1').replace(' ','9')
print(n)


Fixed submission:
n = input()
n = n.replace("1"," ").replace('9','1').replace(' ','9')
print(n)

Buggy python submission (verdict: Runtime Error):
s.replace('1','a')
s.replace('9','1')
s.replace('a','9')
print(str(n))


Fixed submission:
n = input()
n = n.replace("1"," ").replace('9','1').replace(' ','9')
print(n)
Buggy python submission (verdict: Runtime Error):
n = input()
for ans in range(111, 1000, 111):
    if n <= ans:
        break
print(ans)


Fixed submission:
n = input()
for ans in range(111, 1000, 111):
    if int(n) <= ans:
        break
print(ans)

Buggy python submission (verdict: Runtime Error):
n = input()
for ans in range(111, 999, 111):
    if n <= ans:
        break
print(ans)

Fixed submission:
n = input()
for ans in range(111, 1000, 111):
    if int(n) <= ans:
        break
print(ans)
Buggy python submission (verdict: Runtime Error):
N,i = list(map(int,input()))
print(N-i+1)


Fixed submission:
N,i = list(map(int,input().split()))
print(N - i + 1)
Buggy python submission (verdict: Runtime Error):
s = [*input()]
t = [*input()]
flg = 0

for i in range(len(s)):
    if s != t:
        s.append(s[0])
        s.remove(s[0])
    else:
        flg = 1
        break

if flg == 0:
    print("No")
else:
    print("Yes")


Fixed submission:
s = [i for i in input()]
t = [i for i in input()]
flg = 0

for i in range(len(s)):
    if s != t:
        s.append(s[0])
        s.remove(s[0])
    else:
        flg = 1
        break

if flg == 0:
    print("No")
else:
    print("Yes")
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np

N = list(map(int,input().strip().split()))
alist = list(map(int,input().strip().split()))
ans = float("inf")

s = np.array([i for i in range(len(alist))])
slist = alist-s

for i in range(len(alist)):
    num = 0
    xlist = list(map(lambda x:abs(x-slist[i]), slist))
    num = sum(xlist)
    if ans > num:
        ans = num

print(ans)

Fixed submission:
import numpy as np

N = int,input()
alist = list(map(int,input().strip().split()))

s = np.array([i for i in range(len(alist))])
slist = alist-s
slist.sort()

abs_slist = list(map(lambda x:abs(x-slist[len(slist)//2]), slist))

print(sum(abs_slist))
Buggy python submission (verdict: Time Limit Exceeded):
import itertools
import sys
N = int(input())
l = [pow(9,(i+1)) for i in range(5)]

for i in range(7):
  l.append(pow(6,i))
ans = 0

for i in range(20):
  for j in itertools.combinations_with_replacement(l,i):
    if sum(j) == N:
      print(len(j))
      sys.exit()

Fixed submission:
import itertools
import numpy as np
import sys
input = sys.stdin.readline
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()


N = I()

ans = 10e10
for i in range(N+1):
    j = N-i
    cnt = 0
    while i > 0:
        cnt += i%6
        i //= 6
    while j > 0:
        cnt += j%9
        j //= 9
    ans = min(ans,cnt)

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = input()
l = [i for i in S]
ew = [0]
ans = min(l.count("W"),l.count("E"))

i = 0
while True:
    num = S.find("EW",i+1)
    if num != -1:
      ew.append(num)
      i = num
    else:
      break
      
for i in ew:
  ans = min(ans,l[:i+1].count("W") + l[i+1:].count("E"))

print(ans)

Fixed submission:
N = int(input())
S = [i for i in input()]
ans = S.count("E")
cnt = S.count("E")

for i in S:
  if i == "W":
    cnt += 1
  elif i == "E":
    cnt -= 1
    ans = min(ans,cnt)
  
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = input()
l = [i for i in S]
ans = min(l.count("W"),l.count("E"))

for i in range(N):
  a = S.find("EW",i)+1
  if a == -1:
    break
  else:
    ans = min(ans,l[:a].count("W") + l[a:].count("E"))

print(ans)

Fixed submission:
N = int(input())
S = [i for i in input()]
ans = S.count("E")
cnt = S.count("E")

for i in S:
  if i == "W":
    cnt += 1
  elif i == "E":
    cnt -= 1
    ans = min(ans,cnt)
  
print(ans)
Buggy python submission (verdict: Runtime Error):
import sys
import itertools
import math
from collections import deque
MAX_INT = int(10e15)
MIN_INT = -MAX_INT
mod = 1000000007
sys.setrecursionlimit(1000000)
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

A,B,C,X,Y = IL()

ans = 0
if C*2 < A+B:
  ans += C*2 * min(X, Y)
  if X < Y:
    num = (Y - X)*B
    num = min(num, (Y - X)*C*2)
  else:
    num += (X - Y)*A
    num = min(num, (X - Y)*C*2)
  ans += num
  print(ans)
else:
  print(A*X + B*Y)

Fixed submission:
A,B,C,X,Y = list(map(int,input().split()))
  
if X < Y:
  if C*2 <= B:
    print(C*2*Y)
  elif C*2 <= (A+B):
    print(C*2*X + B*(Y-X))
  else:
    print(A*X + B*Y)
else:
  if C*2 <= A:
    print(C*2*X)
  elif C*2 <= (A+B):
    print(C*2*Y + A*(X-Y))
  else:
    print(A*X + B*Y)
Buggy python submission (verdict: Time Limit Exceeded):
import math
import numpy as np
import sys
input = sys.stdin.readline
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

N = I()
csf = [IL() for i in range(N-1)]

ans = [0]*N

for j in range(N-1):
	for i in range(j,N-1):
		if ans[j] <= csf[i][1]:
			ans[j] = csf[i][1] + csf[i][0]
			continue
		else:
			tmp = csf[i][1]//csf[i][2]
			while csf[i][2]*tmp < ans[j]:
				tmp += 1
			ans[j] = csf[i][2]*tmp + csf[i][0]

for i in ans:
	print(i)

Fixed submission:
import math
import numpy as np
import sys
input = sys.stdin.readline
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

N = I()
csf = [IL() for i in range(N-1)]

ans = [0]*N

for j in range(N-1):
	for i in range(j,N-1):
		if ans[j] <= csf[i][1]:
			ans[j] = csf[i][1] + csf[i][0]
			continue
		else:
			tmp = ans[j]//csf[i][2]
			while csf[i][2]*tmp < ans[j]:
				tmp += 1
			ans[j] = csf[i][2]*tmp + csf[i][0]

for i in ans:
	print(i)
Buggy python submission (verdict: Time Limit Exceeded):
import itertools
import numpy as np
import sys
input = sys.stdin.readline
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

N = I()
l = IL()
setl = list(set(l))
lenl = len(setl)
ans = 0
if len(l) == 0:
	pass
else:
	for i in range(lenl):
		num = setl[i]
		tmp = l.count(num)
		if tmp < num:
			ans += tmp
		else:
			ans += tmp-num

print(ans)

Fixed submission:
import collections
import numpy as np
import sys
input = sys.stdin.readline
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

N = I()
l = IL()
cl = collections.Counter(l)

key = list(cl.keys())
value = list(cl.values())

ans = 0
for i in range(len(key)):
	k = int(key[i])
	v = value[i]
	if k <= v:
		ans += v-k
	else:
		ans += v

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import itertools
import numpy as np
import sys
input = sys.stdin.readline
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

N = I()
l = IL()
setl = list(set(l))

ans = 0
if len(l) == 0:
	pass
else:
	for i in range(len(setl)):
		tmp = l.count(setl[i])
		if tmp < setl[i]:
			ans += tmp
		else:
			ans += tmp-setl[i]

print(ans)

Fixed submission:
import collections
import numpy as np
import sys
input = sys.stdin.readline
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

N = I()
l = IL()
cl = collections.Counter(l)

key = list(cl.keys())
value = list(cl.values())

ans = 0
for i in range(len(key)):
	k = int(key[i])
	v = value[i]
	if k <= v:
		ans += v-k
	else:
		ans += v

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import bisect
import numpy as np
import sys
input = sys.stdin.readline
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

N = I()
A = sorted(IL())
B = sorted(IL())
C = sorted(IL())

dp = [0]*N 

ans = 0
for i in range(N):
	dp[i] = bisect.bisect_left(A,B[i])
for i in range(N):
	ans += sum(dp[:bisect.bisect_left(B,C[i])])

print(ans)

Fixed submission:
import bisect
import numpy as np
import sys
input = sys.stdin.readline
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

# 二分探索 #
def nibutan(list,n):
	left = -1
	right = len(list)
	while left+1 != right:
		middle = (left+right)//2
		if list[middle] < n:
			left = middle
		else:
			right = middle
	return left+1

N = I()
A = sorted(IL())
B = sorted(IL())
C = sorted(IL())

dp = [0]*(N+1)

for i in range(N):
	dp[i] = nibutan(A,B[i])

num = 0
for i in range(N):
	num += dp[i]
	dp[i] = num

ans = 0
for i in range(N):
	ans += dp[nibutan(B,C[i])-1]

print(ans)
Buggy python submission (verdict: Runtime Error):
import bisect
import numpy as np
import sys
input = sys.stdin.readline
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

s = S()
t = S()

for i in range(len(s)-len(t),-1,-1):
	cnt = 0
	for j in range(i,i+len(t)-1):
		if s[j] == t[j-i] or s[j] == "?":
			cnt += 1
			continue
		else:
			break
	if cnt == len(t)-1:
		print(s.translate(str.maketrans({'?':'a'}))[:A]+t+s.translate(str.maketrans({'?':'a'}))[A+len(t)-1:])
		exit()

print("UNRESTORABLE")

Fixed submission:
import bisect
import numpy as np
import sys

def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

s = S()
t = S()

f = 0
for i in range(len(s)-len(t),-1,-1):
    for j in range(len(t)):
        if s[i+j] == t[j] or s[i+j] == "?":
            continue
        else:
            break
    else:
        a = s[:i]+t+s[i+len(t):]
        print(a.replace('?', 'a'))
        break
else:
    print("UNRESTORABLE")

Buggy python submission (verdict: Runtime Error):
import bisect
import numpy as np
import sys
input = sys.stdin.readline
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

s = S()
t = S()

for i in range(len(s)-len(t),-1,-1):
	cnt = 0
	for j in range(i,i+len(t)-1):
		if s[j] == t[j-i] or s[j] == "?":
			cnt += 1
			continue
		else:
			break
	if cnt == len(t)-1:
		print(ans[:i]+t+ans[i+len(t)-1:])
		exit()

print("UNRESTORABLE")

Fixed submission:
import bisect
import numpy as np
import sys

def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

s = S()
t = S()

f = 0
for i in range(len(s)-len(t),-1,-1):
    for j in range(len(t)):
        if s[i+j] == t[j] or s[i+j] == "?":
            continue
        else:
            break
    else:
        a = s[:i]+t+s[i+len(t):]
        print(a.replace('?', 'a'))
        break
else:
    print("UNRESTORABLE")
Buggy python submission (verdict: Runtime Error):
A,B,C,D,E,F = list(map(int,input().split()))

tmp = 0
for i in range(30):
  a = A*i
  if a*100 >= F:
    break
  for j in range(30):
    b = B*j
    if a+b == 0:
      continue
    w = (a+b)*100
    if w >= F:
      break
    for k in range(3000):
      c = C*k
      for l in range(3000):
        d = D*l
        s = c+d
        if w + s >= F:
          break
        if (c+d) <= (a+b)*E:
          if (s*100)/w > tmp:
            tmp = (s*100)/w
            ans = [s+w,s]
        else:
          break

print(" ".join(map(str,ans)))

Fixed submission:
A,B,C,D,E,F = list(map(int,input().split()))

tmp = 0
ans = [0,0]
for i in range(31):
  a = A*i
  if a*100 >= F:
    break
  for j in range(31):
    b = B*j
    if a+b == 0:
      continue
    w = (a+b)*100
    if w >= F:
      break
    for k in range(3001):
      c = C*k
      for l in range(3001):
        d = D*l
        s = c+d
        if w + s > F:
          break
        if (c+d) <= (a+b)*E:
          if (s*100)/w >= tmp:
            tmp = (s*100)/w
            ans = [s+w,s]
        else:
          break

print(" ".join(map(str,ans)))
Buggy python submission (verdict: Runtime Error):
N = int(input())
l = list(map(int,input().split()))

data = [0]*(10001)
for i in l:
  data[i-1] += 1
  data[i] += 1
  data[i+1] += 1

print(max(data))

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

data = [0]*(100010)
for i in l:
  data[i-1] += 1
  data[i] += 1
  data[i+1] += 1

print(max(data))
Buggy python submission (verdict: Runtime Error):
def gcd(x, y):
  if y == 0:
    return x
  else:
    return gcd(y, x % y)

N = int(input()) 
time = [int(input()) for i in range(N)]

tmp = time[0]*time[1]//gcd(time[0],time[1])
for i in time:
  if tmp%i!=0:
    tmp = tmp*i//gcd(tmp,i)
    
print(tmp)

Fixed submission:
def gcd(x, y):
  if y == 0:
    return x
  else:
    return gcd(y, x % y)

N = int(input()) 
time = [int(input()) for i in range(N)]

if N==1:
  print(time[0])
else:
  tmp = time[0]*time[1]//gcd(time[0],time[1])
  for i in time:
    if tmp%i!=0:
      tmp = tmp*i//gcd(tmp,i)

  print(tmp)
Buggy python submission (verdict: Runtime Error):
N = int(input())
l = [int(input()) for i in range(N)]

cnt_t = 0
cnt_f = 0

for i in l:
  if i%4=0:
    cnt_f += 1
  else:
    cnt_t += 1

num = N-cnt_t-cnt_f

if num <= cnt_f+1:
  print("Yes")
else:
  print("No")

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

cnt_t = 0
cnt_f = 0

for i in l:
  if i%4==0:
    cnt_f += 1
  elif i%2==0:
    cnt_t += 1

num = N-cnt_t-cnt_f

if cnt_t == 0:
  cnt_f += 1
if num <= cnt_f:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
import collections
import itertools
import numpy as np
import sys
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

def gcd(a,b):
    while b % a:
        a,b = b, a % b
    return a

N,K = IL()
l = IL()

if K <= max(l):
    num = gcd(l[0],l[1])
    for i in l:
        if i%num == 0:
            continue
        else:
            num = gcd(num,i)
    if K%num == 0:
        print("POSSIBLE")
    else:
        print("IMPOSSIBLE")
else:
    print("IMPOSSIBLE")

Fixed submission:
import collections
import itertools
import numpy as np
import sys
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

def gcd(a,b):
    while b % a:
        a,b = b, a % b
    return a

N,K = IL()

if N == 1:
    if K == I():
        print("POSSIBLE")
    else:
        print("IMPOSSIBLE")
else:
    l = IL()
    l.sort(reverse=True)

    if K <= l[0]:
        num = gcd(l[0],l[1])
        for i in l:
            if i%num == 0:
                continue
            else:
                num = gcd(num,i)
        if K%num == 0:
            print("POSSIBLE")
        else:
            print("IMPOSSIBLE")
    else:
        print("IMPOSSIBLE")
Buggy python submission (verdict: Runtime Error):
A,B,C = list(map(int,input().split()))

if A == B and A == C:
  print(-1)
  exit(
else:
  cnt = 0
  while True:
    if A%2==0 and B%2==0 and C%2==0:
      A,B,C = (B+C)//2,(A+C)//2,(A+B)//2
      cnt += 1
      continue
    else:
      break
      
print(cnt)

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

if A == B and A == C:
  if A%2==0:
    print(-1)
  else:
    print(0)
  exit()
else:
  cnt = 0
  while True:
    if A%2==0 and B%2==0 and C%2==0:
      A,B,C = (B+C)//2,(A+C)//2,(A+B)//2
      cnt += 1
      continue
    else:
      break
      
print(cnt)
Buggy python submission (verdict: Runtime Error):
N = int(input())
a = list(map(int,input().split()))

data = []
for i in range(N-1):
  if a[i+1]-a[i] == 0:
    continue
  else:
    data.append(a[i+1]-a[i])

#print(data)
ans = 0
i = 0
while i<len(data)-1:
  if (data[i+1] * data[i]) < 0:
    ans += 1
    i += 1
    left = i
  i += 1
else:
  if left == len(data):
    pass
  else:
    ans += 1
  print(ans)

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

data = []
for i in range(N-1):
  if a[i+1]-a[i] == 0:
    continue
  else:
    data.append(a[i+1]-a[i])
#print(data)

if len(data) <= 1:
  print(1)
else:
  ans = 0
  left = 0
  i = 0
  while left < len(data)-1:
    if data[left]*data[left+1] < 0: # 極値
      ans += 1
      left += 1
      i = left
    left += 1
  else:
    if i == len(data):
      pass
    else:
      ans += 1
    print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
mod = 1000000007

ans = 1
for i in range(1,N+1):
  ans *= i
print(ans %mod)

Fixed submission:
N = int(input())
mod = int(1e9)+7

ans = 1
for i in range(1,N+1):
  ans = (ans*i) %mod
print(ans)
Buggy python submission (verdict: Runtime Error):
Bob, Alice = list(map(int,input().split()))
ans = ["Bob", "Alice", "Draw"]

if Bob == Alice:
  print(ans[2])
elif Bob = 1 or Bob > Alice:
  print(ans[0])
else:
  print(ans[1])

Fixed submission:
Alice, Bob = list(map(int,input().split()))
ans = ["Bob", "Alice", "Draw"]

if Bob == Alice:
  print(ans[2])
elif Alice == 1:
  print(ans[1])
elif Bob == 1:
  print(ans[0])
elif Bob > Alice:
  print(ans[0])
else:
  print(ans[1])