Harryxun/GPT-100-sft-dataset huggingface dataset:
Problem p02971 (python)

Fixed submission:
n = int(input())
a = []
for _ in range(n):
    A = int(input())
    a.append(A)
    
s = sorted(a)
for i in range(n):
    if a[i] == s[-1]:
        print(s[-2])
    else:
        print(s[-1])

Buggy submission (verdict: Runtime Error):
n = int(input())
a = []
for _ in range(n):
    A = int(input())
    a.append(A)
    
s = sorted(a)
for i in range(n):
    if max(a) == a[i]:
        print(ans[-2])
    else:
        print(max(a))
Problem p03000 (python)

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

d = [0]*(n+1)
for i in range(n):
    d[i+1] = d[i] + l[i]
    
ans = 0
for j in range(n+1):
    if d[j] <= x:
        ans += 1
    else:
        break

print(ans)

Buggy submission (verdict: Runtime Error):
n, x = map(int, input().split())
l = list(map(int, input().split()))

d = [0]*(n+1)
for i in range(n):
    d[i+1] = d[i] + l[i]
    
ans = 0
for j in range(n+2):
    if d[j] <= x:
        ans += 1
    else:
        break

print(ans)
Problem p03035 (python)

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

if 13 <= a:
  print(b)
elif 6 <= a and a <= 12:
  print(int(b/2))
elif a <= 5:
  print(0)

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())

if a => 13:
  print(b)
elif 12 >= a and a >= 6:
  print(b/2)
elif a <= 5:
  print(0)
Problem p03076 (python)

Fixed submission:
L = []
x = []
for _ in range(5):
    l = int(input())
    L.append(l)
    x.append((10-(l%10))%10)

ans = 0
for i in range(len(L)):
    ans += L[i]+x[i]

ans = ans - max(x)
print(ans)

Buggy submission (verdict: Runtime Error):
def mod(x):
  if x % 10 == 0:
    return x
  else:
    while True:
      x += 1
      if x % 10 == 0:
        break
    return x
      
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
M = min(A%10, B%10, C%10, D%10, E%10)

if M = A%10:
  ans = A + mod(B) + mod(C) + mod(D) + mod(E)
elif M = B%10:
  ans = mod(A) + B + mod(C) + mod(D) + mod(E)
elif M = C%10:
  ans = mod(A) + mod(B) + C + mod(D) + mod(E)
elif M = D%10:
  ans = mod(A) + mod(B) + mod(C) + D + mod(E)
else:
  ans = mod(A) + mod(B) + mod(C) + mode(D) + E
Problem p03086 (python)

Fixed submission:
# B
s = list(input())

count = 0
l = []
for i in range(len(s)):
    if s[i] == 'A':
        count += 1
        continue
    elif s[i] == 'C':
        count += 1
        continue
    elif s[i] == 'G':
        count += 1
        continue
    elif s[i] == 'T':
        count += 1
        continue
    else:
        l.append(count)
        count = 0
l.append(count)

print(max(l))

Buggy submission (verdict: Runtime Error):
# B
s = list(input())

count = 0
l = []
for i in range(len(s)):
    if s[i] == 'A':
        count += 1
        continue
    elif s[i] == 'C':
        count += 1
        continue
    elif s[i] == 'G':
        count += 1
        continue
    elif s[i] == 'T':
        count += 1
        continue
    else:
        l.append(count)
        count = 0

print(max(l))
Problem p03109 (python)

Fixed submission:
s = list(map(int, input().split('/')))

if s[1] >= 5:
    print('TBD')
elif s[1] <= 4:
    print('Heisei')

Buggy submission (verdict: Runtime Error):
s = list(map(int, input().split('/')))

if s[1] > 5:
    print('TBD')
elif s[i] <= 4:
    print('Heisei')
Problem p03136 (python)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
M = max(a)
a.remove(M)

if M < sum(a):
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
print(a)
if max(a) > sum(a.remove(max(a))):
  print('Yes')
else:
  print('No')
Problem p03351 (python)

Fixed submission:
a, b, c, d = map(int, input().split())

if abs(b-a) <= d and abs(c-b) <= d:
        print('Yes')
elif abs(a-c) <= d:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
a, b, c, d = map(int, input().split())

if abs(b-a) <= d:
    if abs(c-b) <= d:
        print('Yes')
    else:
        print('No')
        break
else:
    print('No')
Problem p03386 (python)

Fixed submission:
A, B, K = map(int, input().split())
if B-A < 2*K:
  for i in range(A, B+1):
    print(i)
else:
  for i in range(0, K):
    print(A+i)
  for i in reversed(range(0, K)):
    print(B-i)

Buggy submission (verdict: Runtime Error):
A, B, K = map(int, input().split())
if B-A < 2*K:
  for i in range(A, B+1):
    print(i)
else:
  for i in range(0, K):
    print(A+i)
  for i in reversed(range(0, K)):
    print(B-i)
A, B, K = map(int, input().split())
if B-A < 2*K:
  for i in range(A, B+1):
    print(i)
else:
  for i in range(0, K):
    print(A+i)
  for i in reversed(range(0, K)):
    print(B-i)
Problem p03415 (python)

Fixed submission:
a = list(map(str, input()))
b = list(map(str, input()))
c = list(map(str, input()))

print(a[0]+b[1]+c[2], end='')

Buggy submission (verdict: Runtime Error):
a = list(map(str, input())
b = list(map(str, input())
c = list(map(str, input())

print(a[0]+b[1]+c[2], end='')

Buggy submission (verdict: Runtime Error):
a = list(map(str, input().split()))
b = list(map(str, input().split()))
c = list(map(str, input().split()))

print(a[0]+b[1]+c[2], end='')
Problem p03434 (python)

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

alice = []
bob = []

while A != []:
	alice.append(max(A))
	A.remove(max(A))
	if A != []:
		bob.append(max(A))
		A.remove(max(A))
	else: 
		break
print(sum(alice)-sum(bob))

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

alice = []
bob = []

while A != []:
	alice.append(max(A))
	A.remove(max(A))
	bob.append(max(A))
	A.remove(max(A))
	
print(sum(alice)-sum(bob))
Problem p03448 (python)

Fixed submission:
A = int(input())
B = int(input())
C = int(input())
X = int(input())
ans = 0
for a in range(A+1):
    for b in range(B+1):
        for c in range(C+1):
            if X == 500*a + 100*b + 50*c:
                ans += 1
            else:
                continue
print(ans)

Buggy submission (verdict: Runtime Error):
A, B, C, X = map(int, input().split())
ans = 0
for a in range(A+1):
    for b in range(B+1):
        for c in range(C+1):
            if X == 500*a + 100*b + 50*c:
                ans += 1
            else:
                continue
print(ans)
Problem p03455 (python)

Fixed submission:
a, b = map(int, input().split())
if (a*b)%2 == 0:
    print('Even')
elif (a*b)%2 == 1:
    print('Odd')

Buggy submission (verdict: Runtime Error):
N = int(input())
t = [0]
x = [0]
y = [0]
for _ in range(N):
    T, X, Y = map(int, input().split())
    t.append(T)
    x.append(X)
    y.append(Y)
    
bool = True
for i in range(N):
    dt = t[i+1]-t[i]
    dist = abs(x[i+1]-x[i])+abs(y[i+1]-y[i])
    if dt < dist:
        bool = False
    elif dist%2 != dt%2:
        bool = False
        
if bool == True:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
n = int(input())
a = []
for i in range(n):
    a.append(list(map(int, input().split())))
x = 0
y = 0


for i in range(len(a)):
  x_goal = a[i][1]
  y_goal = a[i][2]
  if i == 0:
    t = a[i][0]
    if y_goal >= 0:
      while y != y_goal:
        y += 1
        t -= 1
    else:
      while y != y_goal:
        y -= 1
        t -= 1
    for time0 in range(t):
      if x > x_goal:
        x -= 1
      else:
        x += 1
    if x == x_goal:
      continue
    else:
      continue
      
  elif i != 0:
    t = a[i][0]-a[i-1][0]
    t = a[i][0]-a[i-1][0]
  while y != y_goal:
    if y_goal > y:
      y += 1
      t -= 1
    elif y_goal < y:
      y -= 1
      t -= 1
    
    for time1 in range(t):
      if x > x_goal:
        x -= 1
      else:
        x += 1
if x == x_goal:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
a, b = int(input())
if (a*b)%2 == 0:
    print('Even')
elif (a*b)%2 == 1:
    print('Odd')

Buggy submission (verdict: Runtime Error):
a, b = int(input())
if (a*b)%2 == 0:
  print('Even')
elif (a*b)%2 == 1:
  print('Odd')
Problem p03456 (python)

Fixed submission:
a, b = input().split()
ab = int(a + b)
ans = False
for i in range(100000):
    if ab == i**2:
        ans = True
    else:
        continue
if ans == True:
    print('Yes')
elif ans == False:
    print('No')

Buggy submission (verdict: Runtime Error):
a, b = input().split()
ab = int(a + b)
for _ in range(100000):
  if ab == i^2:
    print('Yes')
  else:
    print('No')
Problem p03470 (python)

Fixed submission:
N = int(input())
mochi = set()
for i in range(N):
	r = int(input())
	mochi.add(r)

print(len(mochi))

Buggy submission (verdict: Runtime Error):
n = int(input())
d = [int(input()) for i in range(n)]

num = [0]*100
for i in range(n):
    num[d[i]] += 1

ans = 0
for i in range(100):
    if num[i] > 0:  # num[i] == 1　の方が直観的に理解しやすいかも
        ans += 1
print(ans)
Problem p03494 (python)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
ans = []
for i in range(len(a)):
    count = 0
    while a[i]%2 == 0:
        a[i] = a[i]/2
        count += 1
    if a[i]%2 == 1:
        ans.append(count)
print(min(ans))

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))

import math
from functools import reduce
def gcd(*numbers):
    return reduce(math.gcd, numbers)

def gcd_list(numbers):
    return reduce(math.gcd, numbers)

count = gcd_list(a)
ans = 0
while count%2 == 0:
    ans += 1
    count /= 2
    
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))

import math
from functools import reduce
def gcd(*numbers):
    return reduce(math.gcd, numbers)

def gcd_list(numbers):
    return reduce(math.gcd, numbers)

count = gcd_list(a)
ans = 0
while count%2 == 0:
    ans += 1
    count /= 2
    
print(ans)
Problem p03624 (python)

Fixed submission:
S = set(map(str, (input())))
s = list(S)
s.sort()
alphabet = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
for i in range(len(s)):
    alphabet.remove(s[i])

if alphabet == []:
    print('None')
else:
    print(alphabet[0])

Buggy submission (verdict: Runtime Error):
S = set(map(str, (input())))
s = list(S)
s.sort()
alphabet = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'z']
for i in range(len(s)-1):
    alphabet.remove(s[i])

if alphabet == []:
    print('None')
else:
    print(alphabet[0])

Buggy submission (verdict: Runtime Error):
S = set(map(str, (input())))
s = list(S)
s.sort()
alphabet = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'z']
for i in range(len(s)-1):
    alphabet.remove(s[i])

if alphabet == []:
    print('None')
else:
    print(alphabet[0])
Problem p03657 (python)

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

if a%3 == 0 or b%3 == 0 or (a+b)%3 == 0:
    print('Possible')
else:
    print('Impossible')

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
l = list(map(int, input().split()))
l.sort(reverse=True)
ans = []

for i in range(K):
    ans.append(l[i])
    
print(sum(ans))
Problem p03658 (python)

Fixed submission:
N, K = map(int, input().split())
l = list(map(int, input().split()))
l.sort(reverse=True)
ans = []

for i in range(K):
    ans.append(l[i])
    
print(sum(ans))

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
L = list(map(int, input().split()))
L = L.sorted(reverse=True)
sum = 0

for i in L:
  sum += L[i]

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
L = list(map(int, input().split()))
L = L.sort(reverse=True)
sum = 0

for i in L:
  sum += L[i]
Problem p03796 (python)

Fixed submission:
import math
n = int(input())
print(math.factorial(n)%(10**9+7))

Buggy submission (verdict: Runtime Error):
def fact(n):
    if n == 1:
        return n
    else:
        return n*fact(n-1)
    
n = int(input())
print(fact(n)%(10**9+7))

Buggy submission (verdict: Runtime Error):
def fact(n):
    if n == 1:
        return n
    else:
        return n*fact(n-1)
    
n = int(input())
print(fact(n)%(10**9+7))
Problem p03826 (python)

Fixed submission:
a, b, c, d = map(int, input().split())

print(max(a*b, c*d))

Buggy submission (verdict: Runtime Error):
a, b, c, d = map(int, input())

print(max(a*b, c*d))
Problem p02691 (python)

Fixed submission:
N= int(input())
A = list(map(int,input().split()))
dict_L = {}
for i in range(N):
    if(i+1+A[i] in dict_L.keys()):
        dict_L[i+1+A[i]] += 1
    else:
        dict_L[i+1+A[i]] = 1
cnt = 0
for j in range(N):
    R = j+1-A[j]
    if(R in dict_L.keys()):
        cnt += dict_L[R]
print(cnt)

Buggy submission (verdict: Runtime Error):
N= int(input())
A = list(map(int,input().split()))
dict_L = {}
#dict_R = {}
for i in range(-max(A),N+max(A)):
    dict_L[i] = 0
    #dict_R[i] = 0
for i in range(N):
    dict_L[i+1+A[i]] += 1
    #dict_R[i-A[i]] += 1
cnt = 0
for j in range(N):
    R = j+1-A[j]
    cnt += dict_L[R]
print(cnt)
Problem p02722 (python)

Fixed submission:
N = int(input())
cnt = 0
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.pop(0)
    return divisors
N1_yakusu = make_divisors(N-1)
N_yakusu = make_divisors(N)
cnt += len(N1_yakusu)
for K in N_yakusu:
    new_N = N
    while(new_N%K==0):
        new_N = new_N//K
    if(new_N%K == 1):
        cnt += 1
print(cnt)

Buggy submission (verdict: Runtime Error):
N = int(input())
cnt = 0
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
N1_yakusu = make_divisors(N-1)
N_yakusu = make_divisors(N)
cnt += len(N1_yakusu)
for s in N_yakusu:
    new_N = s
    while(new_N%K==0):
        new_N = new_N//K
    if(new_N%K == 1):
        cnt += 1
print(cnt)
Problem p02747 (python)

Fixed submission:
S = input()
if(S == "hi"or S == "hihi"or S == "hihihi"or S == "hihihihi"or S == "hihihihihi"):
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
S = input()
if(S == "hi"orS == "hihi"orS == "hihihi"orS == "hihihihi"orS == "hihihihihi"):
    print("Yes")
else:
    print("No")
Problem p02922 (python)

Fixed submission:
A,B = map(int,input().split())
if(B == 1):
    print(0)
elif((B-1)%(A-1) == 0):
    print((B-1)//(A-1))
else:
    print(B//A+1)

Buggy submission (verdict: Runtime Error):
A,B = map(int,input().split())
if(B == 1):
    print(0)
elif((B-1)%(A-1) == 0):
    print((B-1)//(A-1)
else:
    print(B//A+1)
Problem p02971 (python)

Fixed submission:
N = int(input())
A = []
for i in range(N):
    A.append(int(input()))
max1 = max(A)
max2 = sorted(A,reverse = True)[1]
for i in range(N):
    if(A[i] == max1):
        print(max2)
    else:
        print(max1)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = []
for i in range(N):
    A.append(int(input()))
max1 = max(A)
index = []
A2 = sorted(A)[1]
for i in range(N):
    if(A[i] == max1):
        print(max2)
    else:
        print(max1)
Problem p02995 (python)

Fixed submission:
import fractions
A,B,C,D = map(int,input().split())
C_wareru = B//C-(A-1)//C
D_wareru = B//D-(A-1)//D
def lcm(a,b):
    return ((a*b) // fractions.gcd(a,b))
CD = lcm(C,D)
CD_wareru = B//CD-(A-1)//CD
print(B-A+1-(C_wareru+D_wareru-CD_wareru))

Buggy submission (verdict: Runtime Error):
import math
A,B,C,D = map(int,input().split())
C_wareru = B//C-(A-1)//C
D_wareru = B//D-(A-1)//D
def lcm(a,b):
    return ((a*b) // math.gcd(a,b))
CD = lcm(C,D)
CD_wareru = B//CD-(A-1)//CD
print(B-A+1-(C_wareru+D_wareru-CD_wareru))
Problem p02981 (python)

Fixed submission:
N, A, B = map(int, input().split())
if N*A < B:
	print(N*A)
else :
	print(B)

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

if __name__ == '__main__':
	N = int(input())
	dam = np.array(list(map(int, input().split())))

	index_ = np.array([1 if i % 2 == 0 else -1 for i in range(N)])
	ans = np.array([])
	for i in range(N):
		ans = np.append(ans, np.dot(dam, index_))
		index_ = np.roll(index_, 1)
	ans = [str(int(i)) for i in ans]

	print(' '.join(ans))
Problem p02640 (python)

Fixed submission:
x, y = map(int, input().split())

ans = 0

for i in range(0, x + 1):
  # i is the number of the crane
  rest = y - (2 * i)
  if rest / 4 == x - i:
    print('Yes')
    ans = 1
    break

if ans == 0:
  print('No')

Buggy submission (verdict: Runtime Error):
x, y = map(int, input().split())

ans = 0

for i in range(0:x + 1):
  rest = y - 2 * i
  if rest % 4 == 0:
    print('Yes')
    ans = 1
    break

if ans == 0:
  print('No')
Problem p02705 (python)

Fixed submission:
import numpy as np
r = int(input())

print(2 * np.pi * r)

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

r = int(input())

print(2*np.pu*r)
Problem p02780 (python)

Fixed submission:
N,K = map(int,input().split())
Data  = map(int,input().split())
Data2 = [0]*N
for idx,data in enumerate(Data):
    e = data * (data+1) / 2 / data
    Data2[idx] = e
#print(Data2)
sum1 = 0
for i in range(K):
    sum1 += Data2[i]
ans = sum1
for i in range(0,N-K):
    sum1 -= Data2[i]
    sum1 += Data2[i+K]
    if ans < sum1:
        ans = sum1
print(ans)

Buggy submission (verdict: Runtime Error):
a = 0
ans = 0

for i in range(n):
    c = 0
    a += p[i]
    s.append(a)
    #print(s)
    if i <= k - 1:
        continue
    else:
        c = a - s[i - k]
        c += k
        #print(c)
        if c > ans:
            ans = c
        else:
            pass

print(ans / 2)

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

n, k = int(n), int(k)

s = []
a = 0
ans = 0

for i in range(n):
    c = 0
    a += p[i]
    s.append(a)
    
    if i <= 2:
        continue
    else:
        c = a - s[i - k + 1]
        c += k
        if c > ans:
            ans = c

print(ans / 2)

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

n, k = int(n), int(k)

s = []
a = 0
ans = 0

for i in range(n):
    c = 0
    a += p[i]
    s.append(a)
    
    if i <= 2:
        continue
    else:
        c = a - s[i - k]
        c += k
        if c > ans:
            ans = c

print(ans / 2)

Buggy submission (verdict: Runtime Error):

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

n, k = int(n), int(k)

s = []
a = 0
ans = 0

for i in range(n):
    c = 0
    a += p[i]
    s.append(a)
    
    if i <= 2:
        continue
    else:
        c = a - s[i - k]
        c += k
        if c > ans:
            ans = c

print(ans / 2)
Problem p02909 (python)

Fixed submission:
s = input()

if s == 'Sunny':
    print('Cloudy')
elif s == 'Cloudy':
    print('Rainy')
elif s == 'Rainy':
    print('Sunny')

Buggy submission (verdict: Runtime Error):
s = input()

if s == 'Sunny':
  print('Cloudy')
elif s == 'Cloudy':
  print('Rainy')
elif s == 'Rainy':
print('Sunny')

Buggy submission (verdict: Runtime Error):
s = input()

if s == 'Sunny':
  print('Cloudy')
elif s == 'Cloudy':
  print('Rainy')
elif s == 'Rainy'
print('Sunny')
Problem p02921 (python)

Fixed submission:
forecast = input()
real = input()

a = 0

for i in range(0,3):
  if forecast[i] == real[i]:
    a += 1
    
print(a)

Buggy submission (verdict: Runtime Error):
forecast = input()
real = input()

a = 0

for i in range(0,2)
  if forecast[i] == real[i]:
    a += 1
    
print(a)
Problem p02934 (python)

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

gyk1 = 0
for i in range(n):
  gyk1 += 1 / a[i]

print(1 / gyk1)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))

gyk1 = 0
for i in range(n):
  gyk1 += 1 / a[i]

print(1 / gyak1)
Problem p02945 (python)

Fixed submission:
ab = list(map(int, input().split()))
a = ab[0]
b = ab[1]

ans1 = a + b
ans2 = a - b
ans3 = a * b

print(max(ans1, ans2, ans3))

Buggy submission (verdict: Runtime Error):
n = list(map(int, input().split()))
a = n[0]
b = n[1]

ab1 = a + b
ab2 = a - b
ab3 = a * b

print(int(max(ab1, ab2, ba3))
Problem p02957 (python)

Fixed submission:
ab = list(map(int, input().split()))
a = ab[0]
b = ab[1]

mid2 = a + b

if mid2 % 2 == 0:
    mid = int(mid2 / 2)
else:
    mid = 'IMPOSSIBLE'
    
print(mid)

Buggy submission (verdict: Runtime Error):
ab = list(map(int, input().split()))
a = ab[0]
b = ab[1]

mid2 = a + b

if mid2 % 2 == 0:
    mid = mid2 / 2
  else:
    mid = 'IMPOSSIBLE'
    
print(mid)

Buggy submission (verdict: Runtime Error):
ab = int(input().split())
a = ab[1]
b = ab[2]

mid2 = a + b
if mid2 % 2 == 0:
    mid = str(mid2 / 2)
   else:
    mid = 'IMPOSSIBLE'
    
print(mid)
Problem p02988 (python)

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

a = 0

for i in range(n - 2):
  p_l = [p[i], p[i + 1], p[i + 2]]
  p_l2 = sorted(p_l)
  if p_l2[1] == p_l[1]:
    a += 1
    
print(int(a))

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

a = 0

for i in range(n - 1):
  p_l = [p[i], p[i + 1], p[i + 2]]
  p_l2 = sorted(p_l)
  if p_l2[1] == p_l[1]:
    a += 1
    
print(int(a))
Problem p02993 (python)

Fixed submission:
s = input()

ans = 0

for i in [0, 1, 2]:
  if s[i] == s[i + 1]:
    ans += 1
    
if ans >= 1:
  print('Bad')
else:
  print('Good')

Buggy submission (verdict: Runtime Error):
s = input()

ans = 0

for i in [0, 1, 2]:
  if s[i] == s[i + 1]:
    ans += 1
  else:
  
if ans >= 1:
  print('Bad')
else:
  print('Good')
Problem p03035 (python)

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

if a >= 13:
  print(b)
elif a >= 6:
  print(int(b/2))
else:
  print(0)

Buggy submission (verdict: Runtime Error):
a,b = [int(input()).split()]

if a >=13:
  print(b)
elif a >= 6:
  print(int(b/2))
else:
  print('0')
Problem p03337 (python)

Fixed submission:
l = list(map(int, input().split()))
a = l[0]
b = l[1]

ans1 = a + b
ans2 = a - b
ans3 = a * b

print(max(ans1, ans2, ans3))

Buggy submission (verdict: Runtime Error):
l = list(map(int, input().split()))
a = l[0]
b = l[1]

ans1 = a + b
ans2 = a - b
ans3 = a * b

print(max(ans1, ans2, ans3)
Problem p03680 (python)

Fixed submission:
N = int(input())
n = []
for i in range(N):
  n.append(int(input()))

a = 1
c = -1

for i in range(N):
  a = n[a-1]
  if a == 2:
    if c < 0:
      c = (i+1)

print(c)

Buggy submission (verdict: Runtime Error):
a

Buggy submission (verdict: Runtime Error):
N = int(input())
n = []
for i in range(N):
  n.append(int(input()))

a = 1
c = -1

for i in range(N):
  a = n[a-1]
  if c != -1:
    if a == 2:
      c = (i+1)
  else:

print(c)
Problem p03943 (python)

Fixed submission:
n = list(map(int, input().split()))
a = n[0]
b = n[1]
c = n[2]

i = 0

if a+b==c:
  i += 1
if b+c==a:
  i += 1
if c+a==b:
  i += 1
  
if i ==1:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
a,b,c = int(input().split())

i = 0

if a+b==c:
  i += 1
if b+c==a:
  i += 1
if c+a==b:
  i += 1
  
if i ==1:
  print('Yes')
else:
  print('No')
Problem p02922 (python)

Fixed submission:
a,b=map(int,input().split())
if b==1:print(0)
elif a==b:print(1)
else:
    if (b-1)%(a-1)>0:print((b-1)//(a-1)+1)
    else:print((b-1)//(a-1))

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
if b==1:print(0)
elif a==b:print(1)
else:
    if (b-1)%(a-1)>0:print((b-1)//(a-1)+n)
    else:print((b-1)//(a-1))

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
if a>b or a==b:print(1)
  elif a<b and b%a==0:print(b//a)
    elif a<b and b%a!=0:print((b//a)+1)
      else:print(0)

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
if a>b:print(1)
  elif a==b:print(1)
    elif a<b and b%a==0:print(b//a)
      elif b==0:print(0)
        else:print(b//(a+1))

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
if a>b:print(1)
  elif a==b:print(1)
    elif a<b and b%a==0:print(b//a)
      elif b==0:print(0)
        else:print(b//a+1)
Problem p02639 (python)

Fixed submission:
print(input().strip().split().index("0") + 1)

Buggy submission (verdict: Runtime Error):
return input().strip().split().index("0") + 1