Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
L, R = map(int, input().split())

m = 2019
for i in range(L, R):
  for j in range(i+1, R+1):
    i %= 2019
    j %= 2019
    m = min(m, i*j % 2019)
    if m == 0: break
      
print(m)
    

Fixed submission:
L, R = map(int, input().split())
 
m = 2019
flag = False
for i in range(L, R):
  for j in range(i+1, R+1):
    m = min(m, i*j % 2019)
    if m == 0: 
      flag = True
      break
  if flag: break
      
print(m)
Buggy python submission (verdict: Runtime Error):
n = int(input())
p = list(map(int, input().split()))
 
ans = 0
for i in range(1, n-1):
  if p[i] >= p[i-1] and p[i] =< p[i+1]: ans += 1

print(ans)

Fixed submission:
n = int(input())
p = list(map(int, input().split()))
 
ans = 0
for i in range(1, n-1):
  M = max(p[i-1], p[i], p[i+1])
  m = min(p[i-1], p[i], p[i+1])
  if p[i] != M and p[i] != m: ans += 1

print(ans)

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

ans = 0
for i in range(1, n-1):
  if p[i] > p[i-1] and p[i] < p[i+1]: ans += 1

print(ans)

Fixed submission:
n = int(input())
p = list(map(int, input().split()))
 
ans = 0
for i in range(1, n-1):
  M = max(p[i-1], p[i], p[i+1])
  m = min(p[i-1], p[i], p[i+1])
  if p[i] != M and p[i] != m: ans += 1

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
 
N = int(input())
d = np.array(list(map(int, input().split())))

ans = 0
for K in range(1, 10**5+1):
  if np.sum(d>=K) == np.sum(d<K): ans += 1
print(ans)

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

d = sorted(d)
print(d[N//2] - d[(N//2)-1])

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

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

ans = 0
for K in range(1, 10**5+1):
  if np.sum(d[d>=K]) == np.sum(d[d<K]): ans += 1

print(ans)

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

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

# 元々の味
s = (N-1)*(2*L+N-1) // 2
l = [abs(s - (L+i)) for i in range(N)]
m = min(l)
print(s - (L + [l.index(m)]))

Fixed submission:
N, L = map(int, input().split())
 
s = N*(2*L+N-1) // 2
l = [abs(L+i) for i in range(N)]

print(s - (L+l.index(min(l))))
Buggy python submission (verdict: Time Limit Exceeded):
import math
A, B, C, D = map(int, input().split())

# CでもDでも割り切れない = 全体(a) - Cで割り切れる(b) + Dで割り切れる(c) + CでもDでも割り切れる(d)
lcm = C*D // math.gcd(C, D)

a, b, c, d = B-A+1, 0, 0, 0
for i in range(A, B+1):
  if i % C == 0: b += 1
  if i % D == 0: c += 1
  if i % lcm == 0: d += 1

print(a-b-c+d)

Fixed submission:
import math
A, B, C, D = map(int, input().split())
 
# CでもDでも割り切れない = 全体(a) - Cで割り切れる(b) + Dで割り切れる(c) + CでもDでも割り切れる(d)
lcm = C*D // math.gcd(C, D)
a = B - A + 1
b = B // C - (A-1) // C
c = B // D - (A-1) // D
d = B // lcm - (A-1) // lcm

print(a-b-c+d)
Buggy python submission (verdict: Runtime Error):
W, H, x, y = map(int, input().split())

if x == W / 2 and y == H / 2:
  print((W * H) / 2, 1)
else:
  print((W * H) / 2, 0)

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

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

if (x == 0 and y == 0) or (x == 0 and y == H) or (x == W and Y == 0) or (x == W and y == H): print(W * H)
else:
  if ((x == 0 or x == H) and y <= H / 2): print(W * y)
  elif ((x == 0 or x == H) and y > H / 2): print(W * (H - y))
  elif (x >= W / 2 and (y == 0 or y == H)): print(x * H)
  elif (x <= W / 2 and (y == 0 or y == H)): print((W-x)*H)
  else:
    if H / 2 >= y and W / 2 >= x:
      a = x * H
      b = W * y
    elif H / 2 >= y and W / 2 < x:
      a = (W-x) * H
      b = W * y
    elif H / 2 < y and W / 2 >= x: 
      a = x * H
      b = W * (H-y)
    else:
      a = (W-x) * H
      b = W * (H-y)
    if a == b: print(a, 1)
    else: print(max(a, b), 0)

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

# O(N^2)で解いても間に合う
m = 10**10
for i in range(1, N):
  a, b = 0, 0
  for j in range(i):
    a += W[j]
  for j in range(i, N):
    b += W[j]
  m = min(m, abs(a-b))
print(m)

Fixed submission:
P, Q, R = map(int, input().split())

print(min(P+Q, Q+R, R+P))
Buggy python submission (verdict: Runtime Error):
N = int(input())
W = list(map(int, input().split()))

m = 10**10
for i in range(1, W):
  m = min(m, abs(sum(W[:i]), sum(W[i:])))

print(m)

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

m = 10**10
for i in range(1, N):
  m = min(m, abs(sum(W[:i]) - sum(W[i:])))
                 
print(m)
Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())

if S[K-1] == 'A': rep = 'a'
elif S[K-1] == 'B': rep = 'b'
else: rep = 'c'
  
print(S[:K] + rep + S[K+1:])
  

Fixed submission:
N, K = map(int, input().split())
S = input()
 
if S[K-1] == 'A': rep = 'a'
elif S[K-1] == 'B': rep = 'b'
else: rep = 'c'

# (K-1)文字目まで + K文字目 + K+1文字目から
print(S[:K-1] + rep + S[K:])
Buggy python submission (verdict: Runtime Error):
N, A = map(int, input().split())

if N // 500 <= A: print('Yes')
else: print('No')

Fixed submission:
N = int(input())
A = int(input())
 
if N % 500 <= A: print('Yes')
else: print('No')
Buggy python submission (verdict: Runtime Error):
S = input()

S[4] = '8'
print(S)

Fixed submission:
S = input()
print(S.replace('2017', '2018'))
Buggy python submission (verdict: Runtime Error):
N = int(input())
D = [int(input()) for _ in range(N)]
 
l = [0]*100
for i in range(N):
  l[d[i]-1] = 1
  
print(sum(l))

Fixed submission:
N = int(input())
d = [int(input()) for _ in range(N)]

d = list(set(d))
print(len(d))
Buggy python submission (verdict: Runtime Error):
S = list(input())
print(sum(S))

Fixed submission:
S = list(input())
S = list(map(int, S))
print(sum(S))
Buggy python submission (verdict: Runtime Error):
A, B = map(int, input().split())
 
if A + B < 10: print(str(C))
else: print('error')

Fixed submission:
A, B = map(int, input().split())
 
if A + B < 10: print(A+B)
else: print('error')

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

if A + B < 10: print(C)
else: print('error')

Fixed submission:
A, B = map(int, input().split())
 
if A + B < 10: print(A+B)
else: print('error')
Buggy python submission (verdict: Runtime Error):
c = int(input())
if c == 'a' or c == 'i' or c == 'u' or c == 'e' or c == 'o': print('vowel')
else: print('consonant')

Fixed submission:
c = input()
if c == 'a' or c == 'i' or c == 'u' or c == 'e' or c == 'o': print('vowel')
else: print('consonant')
Buggy python submission (verdict: Runtime Error):
N = str(input())

s = list(map(int,N))

S = sum(s)

if S % 9 = 0:
  print(Yes)
else:
  print(No)

Fixed submission:
N = str(input())
M = list(map(int, N))
S = sum(M)

if S % 9 == 0:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
ss = str(input())
a = ss.count("R")

if ss = "RSR":
  a = 1

print(a)

Fixed submission:
ss = str(input())
a = int(ss.count("R"))

if ss == "RSR":
  a = 1

print(a)

Buggy python submission (verdict: Runtime Error):
ss = str(input())
a = ss.count("R")

if a == 2 and a[2] == 0:
  a = 1

print(a)  


Fixed submission:
ss = str(input())
a = int(ss.count("R"))

if ss == "RSR":
  a = 1

print(a)
Buggy python submission (verdict: Runtime Error):
X = int(input())

if X < 30:
  print(No)
else:
  print(Yes)

Fixed submission:
X = int(input())

if X < 30:
  print("No")
else:
  print("Yes")
Buggy python submission (verdict: Time Limit Exceeded):
import math
ini = lambda : int(input())
inm = lambda : map(int,input().split())
inl = lambda : list(map(int,input().split()))
gcd = lambda x,y : gcd(y,x%y) if x%y else y
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
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    divisors.sort()
    return divisors
mod = 10**9 + 7

#maincode-------------------------------------------------

n = ini()
a = inl()
ans = 0
for i in range(n-1):
    for j in range(i + 1,n):
        ans += a[i] * a[j]
        ans = ans % mod
print(ans)

Fixed submission:
import math
ini = lambda : int(input())
inm = lambda : map(int,input().split())
inl = lambda : list(map(int,input().split()))
gcd = lambda x,y : gcd(y,x%y) if x%y else y
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
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    divisors.sort()
    return divisors
mod = 10**9 + 7

#maincode-------------------------------------------------

n = ini()
a = inl()
b = a[::]
ans = 0
for i in range(n-2,0,-1):
    a[i] += a[i+1]%mod

for i in range(n-1):
    ans += a[i+1] * b[i]
    ans = ans % mod
    
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(int,input().split())
a = list(map(int,input().split()))
b = a[:]
for i in range(1,k):
    a[i] = a[i] * a[i-1]
for i in range(k,n):
    a[i] = a[i] * a[i-1] // b[i-k]
    if a[i] > a[i-1]:
        print('Yes')
    else:
        print('No')


Fixed submission:
n,k = map(int,input().split())
a = list(map(int,input().split()))
for i in range(k,n):
    if a[i] > a[i-k]:
        print('Yes')
    else:
        print('No')

Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(int,input().split())
a = list(map(int,input().split()))
for i in range(1,k+1):
    a[i] = a[i] * a[i-1]

if a[k]/a[0] <= a[k-1]:
    print('No')
else:
    print('Yes')
for i in range(k+1,n):
    a[i] = a[i] * a[i-1]
    if a[i]/a[i-k] <= a[i-1]/a[i-k-1]:
        print('No')
    else:
        print('Yes')


Fixed submission:
n,k = map(int,input().split())
a = list(map(int,input().split()))
for i in range(k,n):
    if a[i] > a[i-k]:
        print('Yes')
    else:
        print('No')

Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(int,input().split())
a = list(map(int,input().split()))
for i in range(1,n):
    a[i] = a[i] * a[i-1]

if a[k]/a[0] <= a[k-1]:
    print('No')
else:
    print('Yes')
for i in range(k+1,n):
    if a[i]/a[i-k] <= a[i-1]/a[i-k-1]:
        print('No')
    else:
        print('Yes')


Fixed submission:
n,k = map(int,input().split())
a = list(map(int,input().split()))
for i in range(k,n):
    if a[i] > a[i-k]:
        print('Yes')
    else:
        print('No')
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
ans = 0
for i in range(1,n+1):
    for j in range(i,n + 1,i):
        ans += j
print(ans)

Fixed submission:
n = int(input())
ans = 0
for i in range(1,n+1):
    for j in range(i,n + 1,i):
        ans += j
print(ans)
Buggy python submission (verdict: Runtime Error):
  1 ini = lambda : int(input())
  2 inm = lambda : map(int,input().split())
  3 inl = lambda : list(map(int,input().split()))
  4 gcd = lambda x,y : gcd(y,x%y) if x%y else y
  5 a = input()
  6 if ord(a) < ord('a'):
  7         print('A')
  8 else: 
  9         print('a')


Fixed submission:
import sys

x = input()
if ord(x) < 91:
    print('A')
else:
    print('a')
Buggy python submission (verdict: Runtime Error):
import sys

x,n = map(int,input().split())
if n != 0:
    p = list(map(int,input().split()))
else:
    p = [102]
sa = 201

for i in range(100):
    if abs(i-x+1) < sa:
        if not((i+1) in p):
            sa = abs(i-x+1)
            ans = i+1
print(ans)

Fixed submission:
import sys

x,n = map(int,input().split())
p = list(map(int,input().split()))

sa = 300

for i in range(102):
    if abs(i-x) < sa:
        if not((i) in p):
            sa = abs(i-x)
            ans = i
print(ans)

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

x,n = map(int,input().split())
p = list(map(int,input().split()))

sa = 201

for i in range(100):
    if abs(i-x+1) < sa:
        if not((i+1) in p):
            sa = abs(i-x+1)
            ans = i+1
print(ans)

Fixed submission:
import sys

x,n = map(int,input().split())
p = list(map(int,input().split()))

sa = 300

for i in range(102):
    if abs(i-x) < sa:
        if not((i) in p):
            sa = abs(i-x)
            ans = i
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
ini = lambda : int(input())
inm = lambda : map(int,input().split())
inl = lambda : list(map(int,input().split()))
gcd = lambda x,y : gcd(y,x%y) if x%y else y

n = ini()
a = inl()
ans = 1
lim = 10 ** 18
for i in a:
        ans *= i
if ans > lim:
        ans = -1
print(ans)


Fixed submission:
import math
import re
import copy
import sys

n = int(input())
a = list(map(int,input().split()))
ceil = 10 ** 18
ans = 1
if all([b > 0 for b in a]):
    for i in range(n):
        ans *= a[i]
        if ans > ceil:
            break
if any([b == 0 for b in a]):
    print(0)
elif ans > ceil:
    print("-1")
else:
    print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import math
import re
import copy
import sys

n = int(input())
a = list(map(int,input().split()))
ceil = 10 ** 18
ans = 1
for i in range(n):
    ans *= a[i]
if ans > ceil:
    print("-1")
else:
    print(ans)

Fixed submission:
import math
import re
import copy
import sys

n = int(input())
a = list(map(int,input().split()))
ceil = 10 ** 18
ans = 1
if all([b > 0 for b in a]):
    for i in range(n):
        ans *= a[i]
        if ans > ceil:
            break
if any([b == 0 for b in a]):
    print(0)
elif ans > ceil:
    print("-1")
else:
    print(ans)
Buggy python submission (verdict: Runtime Error):
 = int(input())
a = 100
c = 0
while a < x:
    a += a//100
    c += 1
print(c)


Fixed submission:
x = int(input())
a = 100
c = 0
while a < x:
    a += a//100
    c += 1
print(c)
Buggy python submission (verdict: Time Limit Exceeded):
ini = lambda : int(input())
inm = lambda : map(int,input().split())
inl = lambda : list(map(int,input().split()))
gcd = lambda x,y : gcd(y,x%y) if x%y else y
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
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    divisors.sort()
    return divisors

#maincode-------------------------------------------------
n = ini()
s = input()
ans = 0
for k in range(n):
    for j in range(k):
        if s[k] == s[j]:
            continue
        for i in range(j):
            if j-i == k-j:
                continue
            if s[k] == s[i]:
                continue
            if s[i] == s[j]:
                continue
            ans += 1

print(ans)

Fixed submission:
ini = lambda : int(input())
inm = lambda : map(int,input().split())
inl = lambda : list(map(int,input().split()))
gcd = lambda x,y : gcd(y,x%y) if x%y else y
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
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    divisors.sort()
    return divisors

#maincode-------------------------------------------------
n = ini()
s = input()
r = s.count('R')
g = s.count('G')
b = s.count('B')
ans = r*g*b

for j in range(n):
    for i in range(j):
        k = 2*j-i
        if k < n:
            if (s[i] == s[j]):
                continue
            if (s[i] == s[k]):
                continue
            if (s[j] == s[k]):
                continue
            ans -= 1
print(ans)
Buggy python submission (verdict: Runtime Error):
import math
def py():
    print("Yes")
def pn():
    print("No")
def iin():
    x = int(input())
    return x

neko = 0
nya = 0
nuko = 0
a = [[0] * 3] * 3
x = [[0] * 3] * 3
for i in range(3):
    for j in range(3):
        a[i][j] = iin()
n = iin()
b = [0] * n
for i in range(n):
    b[i] = iin()

for i in range(3):
    for j in range(3):
        for f in range(3):
            if a[i][j] == b[f]:
                x[i][j] = 1
for i in range(3):
    if sum(x[i]) == 3:
        neko = neko + 1
    nya = x[0][i] + x[1][i] + x[2][i]
    if nya == 3:
        neko = neko + 1
nya = x[0][0]+ x[1][1] + x[2][2]
if nya == 3:
    neko = neko + 1
nya = x[0][2]+ x[1][1] + x[2][0]
if nya == 3:
    neko = neko + 1
if neko > 0:
    py()
else:
    pn()

Fixed submission:
import math
def py():
    print("Yes")
def pn():
    print("No")
def iin():
    x = int(input())
    return x

neko = 0
nya = 0
nuko = 0
a = [] 
x = [[0] * 3 for i in range(3)]
for i in range(3):
    a.append([int(x) for x in input().split()])
n = iin()
b = [0] * n
for i in range(n):
    b[i] = iin()

for i in range(3):
    for j in range(3):
        for f in range(n):
            if a[i][j] == b[f]:
                x[i][j] = 1
for i in range(3):
    if sum(x[i]) == 3:
        neko = neko + 1
    nya = x[0][i] + x[1][i] + x[2][i]
    if nya == 3:
        neko = neko + 1
nya = x[0][0]+ x[1][1] + x[2][2]
if nya == 3:
    neko = neko + 1
nya = x[0][2]+ x[1][1] + x[2][0]
if nya == 3:
    neko = neko + 1
if neko > 0:
    py()
else:
    pn()
Buggy python submission (verdict: Runtime Error):
n = int(input())
x = [int(input()) for i in range(n)]
e = sum(x)//len(x)
k = 0
for i in range(len(x)):
    k = k + (x[i] - e)*(x[i] - e)
print(k)

Fixed submission:
n = int(input())
x = [int(x) for x in input().split()]
e = round(sum(x)/len(x))
k = 0
for i in range(len(x)):
    k = k + (x[i] - e)*(x[i] - e)
print(k)
Buggy python submission (verdict: Runtime Error):
a,b,c = map(int,input().split())
if (a == b and a == c) or (a != b and a != c and b != c):
    print('No')
else:
    print('Yes')
~                   

Fixed submission:
a,b,c = map(int,input().split())
if (a == b and a == c) or (a != b and a != c and b != c):
    print('No')
else:
    print('Yes')
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))
if any(a[i] in a[:i] or a[i] in a[i+2:] for i in range(n)):
    print('NO')
else:
    print('YES')


Fixed submission:
n = int(input())
a = list(map(int,input().split()))
a = sorted(a)
if any(a[i] == a[i+1] for i in range(n-1)):
    print('NO')
else:
    print('YES')
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
p = list(map(int,input().split()))
ans = 0
for i in range(n):
    if all(p[i] <= p[j] for j in range(i)):
        ans += 1
print(ans)


Fixed submission:
import math
import copy

neko = 0
low = 10**6
n = int(input())
p = [int(x) for x in input().split()]
for i in range(n):
    if p[i]<low:
        neko += 1
    if p[i]<low:
        low = p[i]
print(neko)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
p = list(map(int,input().split()))
c = 0
for i in range(n):
    c += all(p[i] <= p[j] for j in range(i))
print(c)


Fixed submission:
import math
import copy

neko = 0
low = 10**6
n = int(input())
p = [int(x) for x in input().split()]
for i in range(n):
    if p[i]<low:
        neko += 1
    if p[i]<low:
        low = p[i]
print(neko)

Buggy python submission (verdict: Time Limit Exceeded):
import math
import copy

neko = 0
n = int(input())
p = [int(x) for x in input().split()]
for i in range(n):
    if p[i] <= min(p[:i+1]):
        neko += 1
print(neko)

Fixed submission:
import math
import copy

neko = 0
low = 10**6
n = int(input())
p = [int(x) for x in input().split()]
for i in range(n):
    if p[i]<low:
        neko += 1
    if p[i]<low:
        low = p[i]
print(neko)

Buggy python submission (verdict: Time Limit Exceeded):
import math
import copy

neko = 0
n = int(input())
p = [int(x) for x in input().split()]
for i in range(n):
    for j in range(i):
        if p[i] > p[j]:
            neko += 1 
            break
print(n-neko)

Fixed submission:
import math
import copy

neko = 0
low = 10**6
n = int(input())
p = [int(x) for x in input().split()]
for i in range(n):
    if p[i]<low:
        neko += 1
    if p[i]<low:
        low = p[i]
print(neko)
Buggy python submission (verdict: Runtime Error):
print((int(input())**2)

Fixed submission:
print((int(input()))**2)
Buggy python submission (verdict: Time Limit Exceeded):
a,b = map(int,input().split())
#素数列挙
sosu = [2]
li = min(a,b)
for i in range(3,li+1,2):
    f = 0
    for j in sosu:
        if i%j == 0:
            f = 1
            break
    if f == 0:
        sosu.append(i)

sosu.append(1)
ans = 0
for i in sosu:
    if a%i == 0 and b%i == 0:
        ans += 1

print(ans)


Fixed submission:
a,b = map(int,input().split())
def gcd(x,y):
    if y == 0:
        return x
    return gcd(y,x%y)

n = gcd(a,b)
ans = 0
i = 2
while i*i <= n:
    if n%i == 0:
        while n%i == 0:
            n /= i
        ans += 1
    i += 1
if n != 1:
    ans += 1
print(ans+1)

Buggy python submission (verdict: Time Limit Exceeded):
a,b = map(int,input().split())
#素数列挙
sosu = [2]
li = min(a,b)
for i in range(3,li+1):
    if all(i%j != 0 for j in sosu):
        sosu.append(i)

sosu.append(1)
ans = 0
for i in sosu:
    if a%i == 0 and b%i == 0:
        ans += 1

print(ans)


Fixed submission:
a,b = map(int,input().split())
def gcd(x,y):
    if y == 0:
        return x
    return gcd(y,x%y)

n = gcd(a,b)
ans = 0
i = 2
while i*i <= n:
    if n%i == 0:
        while n%i == 0:
            n /= i
        ans += 1
    i += 1
if n != 1:
    ans += 1
print(ans+1)
Buggy python submission (verdict: Runtime Error):
n = iin()
a = [int(x) for x in input().split()]
for i in range(n-1):
    a.sort()
    a[i + 1] = (a[i]+a[i + 1])/2
print(a[n-1])

Fixed submission:
import math
def py():
    print("Yes")
def pn():
    print("No")
def iin():
    x = int(input())
    return x

neko = 0
nya = 0
nuko = 0

n = iin()
a = [int(x) for x in input().split()]
for i in range(n-1):
    a.sort()
    a[i + 1] = (a[i]+a[i + 1])/2
print(a[n-1])
Buggy python submission (verdict: Runtime Error):
a,b = map(int,input().split())                                    │abc136  abc138  abc140  abc142  abc144  abc146  abc148
k = a+b                                                           │abc137  abc139  abc141  abc143  abc145  abc147  python
if k%2:                                                           │(base) rrif@rrif-dynabook-T65-EG:~/document/atcoder$ mkdir abc 13
    print('INPOSSIBLE')                                           │5
else:                                                             │(base) rrif@rrif-dynabook-T65-EG:~/document/atcoder$ rm -r abc
    print(k//2) 

Fixed submission:
a,b = map(int,input().split())
k = a+b
if k%2:
    print('IMPOSSIBLE')
else:
    print(k//2)