Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
s = str(input())

if s == "Sunny":
    print("Cloudy")
elif s == "Cloudy":
    print("Rainy")
else:
    print("Sunny":)

Fixed submission:
s = str(input())

if s == "Sunny":
    print("Cloudy")
elif s == "Cloudy":
    print("Rainy")
else:
    print("Sunny")
Buggy python submission (verdict: Runtime Error):
N = int(input())
H = list(map(int,input().split()))
ans = []
temp = 0

for i in range(0,N-1):
    if H[i] >= H[i+1]:
        temp += 1
    else:
        temp = 0
    ans.append(temp)
        
print(max(ans))

Fixed submission:
N = int(input())
H = list(map(int,input().split()))
temp = 0
ans = []

for i in range(N-1):
    if H[i] >= H[i+1]:
        temp += 1
    else:
        ans.append(temp)
        temp = 0
ans.append(temp)

print(max(ans))

Buggy python submission (verdict: Runtime Error):
N = int(input())
H = list(map(int,input().split()))
ans = []
temp = 0

for i in range(N-1):
    if H[i] >= H[i+1]:
        temp += 1
    else:
        temp = 0
    ans.append(temp)
        
print(max(ans))

Fixed submission:
N = int(input())
H = list(map(int,input().split()))
temp = 0
ans = []

for i in range(N-1):
    if H[i] >= H[i+1]:
        temp += 1
    else:
        ans.append(temp)
        temp = 0
ans.append(temp)

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

for i in range(N+1):
    A[i] = 1 / A[i]

print(1 / sum(A))

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

for i in range(N):
    A[i] = 1 / A[i]

print(1 / sum(A))
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int,input().split()))
pre = -999
frag = 0

for i in range(N+1):
    if A[i]-1 >= pre:
        pre = A[i] - 1
    elif A[i] >= pre:
        pre = A[i]
    else:
        frag += 1
        break
        
if frag == 1:
    print("No")
else:
    print("Yes")

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
pre = -999
frag = 0

for i in range(N):
    if A[i]-1 >= pre:
        pre = A[i] - 1
    elif A[i] >= pre:
        pre = A[i]
    else:
        frag += 1
        break
        
if frag == 1:
    print("No")
else:
    print("Yes")

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int,input().split()))
frag = 0
tmp = 0
 
for i in range(0,N):
    if A[i] > A[i+1]:
        A[i] = A[i] - 1
        tmp = max(A)
        if A[i] > A[i+1] or tmp > A[i+1]:
            frag += 1
            break
 
if frag == 1:
    print("No")
else:
    print("Yes")

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
pre = -999
frag = 0

for i in range(N):
    if A[i]-1 >= pre:
        pre = A[i] - 1
    elif A[i] >= pre:
        pre = A[i]
    else:
        frag += 1
        break
        
if frag == 1:
    print("No")
else:
    print("Yes")

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

for i in range(0,N):
    if A[i] > A[i+1]:
        A[i] -= 1
        tmp = A[i]
        if A[i-1] > A[i] or tmp > A[i+1]:
            frag += 1
            break

if frag >= 1:
    print("No")
else:
    print("Yes")

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
pre = -999
frag = 0

for i in range(N):
    if A[i]-1 >= pre:
        pre = A[i] - 1
    elif A[i] >= pre:
        pre = A[i]
    else:
        frag += 1
        break
        
if frag == 1:
    print("No")
else:
    print("Yes")
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int,input().split()))
cnt = 0

for i in range(N-1):
    if A[i]+1 != A[i+1]:
        cnt += 1

if cnt <= 2:
    print("YES")
elif cnt > 3:
    print("NO")

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

if N % 2 == 0:
    print((A+B)//2)
elif N % 2 != 0:
    print("IMPOSSIBLE")
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
l = []
for _ in range(n):
    a = int(input())
    l.append(a)

ans = []
tmp = 0
cnt = 0

for i in range(n):
    tmp = []
    for m in range(n):
        if i != m:
            tmp.append(l[m])
    ans.append(max(tmp))


for j in range(n):
    print(ans[j])

Fixed submission:
n = int(input())
l = []
for _ in range(n):
    a = int(input())
    l.append(a)

l2 = l
l2 = sorted(l2)
l2.reverse()
max = max(l)


ans = []
if l2[1] == max:
    for i in range(n):
        print(max)
else:
    for j in l:
        if j != max:
            print(max)
        else:
            print(l2[1])
Buggy python submission (verdict: Runtime Error):
S = sorted(str,input())
Scnt = len(S)
Sset = set(S)

if Scnt == Sset:
    print("Good")
else:
    print("Bad")

Fixed submission:
S = [str(x) for x in input()]
cnt = 0
 
for i in range(0,3):
    if S[i] == S[i+1]:
        cnt += 1
 
if cnt >= 1:
    print("Bad")
else:
    print("Good")
Buggy python submission (verdict: Runtime Error):
w,h,x,y = map(int,input().split())
tmp1 = abs(w-x)
tmp2 = abs(h-y)

f = 0
if w%h == 0 and x%y == 0:
    f = 1

if tmp1 > tmp2:
    tmp = min(tmp2,y)
    print(w*tmp,f)
else:
    tmp = min(tmp1,x)
    print(h*tmp,f)

Fixed submission:
w,h,x,y = map(int,input().split())
tmp1 = abs(w-x)
tmp2 = abs(h-y)

ans = w*h/2

if x == w/2 and y == h/2:
    print(ans,1)
else:
    print(ans,0)
Buggy python submission (verdict: Time Limit Exceeded):
n,m = map(int,input().split())
a = ([int(input()) for i in range(m)])
inf = 1000000007

dp = [0] * (n+1)
dp[0] = 1

if 1 not in a:
    dp[1] = 1
else:
    dp[1] = 0

for i in range(2,n+1):
    if i in a:
        continue
    dp[i] = dp[i-1] + dp[i-2]
    dp[i] %= inf

print(dp[n])

Fixed submission:
n,m = map(int,input().split())
a = set([int(input()) for i in range(m)])
inf = 1000000007

dp = [0] * (n+1)
dp[0] = 1

if 1 not in a:
    dp[1] = 1
else:
    dp[1] = 0

for i in range(2,n+1):
    if i in a:
        continue
    dp[i] = dp[i-1] + dp[i-2]
    dp[i] %= inf

print(dp[n])

Buggy python submission (verdict: Time Limit Exceeded):
n,m = map(int,input().split())
a = []
for _ in range(m):
    b = int(input())
    a.append(b)
inf = 1000000007

dp = [0] * (n+1)
dp[0] = 1

if 1 not in a:
    dp[1] = 1
else:
    dp[1] = 0

for i in range(2,n+1):
    if i in a:
        continue
    dp[i] = dp[i-1] + dp[i-2]
    dp[i] %= inf

print(dp[n])

Fixed submission:
n,m = map(int,input().split())
a = set([int(input()) for i in range(m)])
inf = 1000000007

dp = [0] * (n+1)
dp[0] = 1

if 1 not in a:
    dp[1] = 1
else:
    dp[1] = 0

for i in range(2,n+1):
    if i in a:
        continue
    dp[i] = dp[i-1] + dp[i-2]
    dp[i] %= inf

print(dp[n])

Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
a = []
for _ in range(m):
    b = int(input())
    a.append(b)
inf = 1000000007

dp = [0] * (n+1)
dp[0] = 1

if 1 not in a:
    dp[1] = 1
else:
    dp[1] = 0

for i in range(2,n+1):
    if i in a:
        continue
    dp[i] = dp[i-1] + dp[i-2]
    dp[i] %= inf
    print(dp)

print(dp[n])

Fixed submission:
n,m = map(int,input().split())
a = set([int(input()) for i in range(m)])
inf = 1000000007

dp = [0] * (n+1)
dp[0] = 1

if 1 not in a:
    dp[1] = 1
else:
    dp[1] = 0

for i in range(2,n+1):
    if i in a:
        continue
    dp[i] = dp[i-1] + dp[i-2]
    dp[i] %= inf

print(dp[n])
Buggy python submission (verdict: Runtime Error):
N,M = map(int,input().split())
S = str(input())
SA = list(S)
D = ["a" , "b" , "c"]

if SA[M] == "A":
    SA[M] = D[0]
elif SA[M] == "B":
    SA[M] = D[1]
elif SA[M] == "C"
    SA[M] = D[2]

M = ''.join(SA)

print(M)

Fixed submission:
N,M = map(int,input().split())
S = str(input())
SA = list(S)
D = ["a" , "b" , "c"]

if SA[M-1] == "A":
    SA[M-1] = D[0]
elif SA[M-1] == "B":
    SA[M-1] = D[1]
elif SA[M-1] == "C":
    SA[M-1] = D[2]

M = ''.join(SA)

print(M)

Buggy python submission (verdict: Runtime Error):
N,M = map(int,input().split())
S = str(input())
SA = list(S)
D = ["a" , "b" , "c"]

if SA[M] == "A":
    SA[M] = D[0]
elif SA[M] == "B":
    SA[M] = D[1]
else:
    SA[M] = D[2]

M = ''.join(SA)

print(M)

Fixed submission:
N,M = map(int,input().split())
S = str(input())
SA = list(S)
D = ["a" , "b" , "c"]

if SA[M-1] == "A":
    SA[M-1] = D[0]
elif SA[M-1] == "B":
    SA[M-1] = D[1]
elif SA[M-1] == "C":
    SA[M-1] = D[2]

M = ''.join(SA)

print(M)
Buggy python submission (verdict: Runtime Error):
A = str(input())
AC = list(A)
AB = A[0] + A[1]
AC = A[2] + A[3]

if 1 <= AB <= 12:
    if 1 <= AC <= 99:
        print("AMBIGUOUS")
    else:
        print("MMYY")
elif 1 <= AC <= 12:
     if 1 <= AB <= 99:
        print("AMBIGUOUS")
    else:
        print("YYMM")
elif AB == 0 or AB >= 13:
    if AC == 0 or AC >= 13:
        print("NA")

Fixed submission:
A = str(input())
AC = list(A)
AB = int(A[0] + A[1])
AC = int(A[2] + A[3])

if 1 <= AB <= 12 and 1 <= AC <= 12:
    print("AMBIGUOUS")
elif 1 <= AB <= 12:
    print("MMYY")
elif 1 <= AC <= 12:
    print("YYMM")
else:
    print("NA")
Buggy python submission (verdict: Runtime Error):
n = int(input())

if n == "A":
    print("T")
elif n == "T":
    print("A")
elif n == "C":
    print("G")
else:
    print("C")

Fixed submission:
n = str(input())

if n == "A":
    print("T")
elif n == "T":
    print("A")
elif n == "C":
    print("G")
else:
    print("C")
Buggy python submission (verdict: Runtime Error):
n,q = map(int,input().split())
s = list(map(str,input()))
lr = [0] * (n+1)

for i in range(n):
    if s[i] == "A" and s[i+1] == "C":
        lr[i+1] = lr[i]+1
    else:
        lr[i+1] = lr[i]

for i in range(q):
    st,fn = map(int,input().split())
    print(lr[fn-1] - lr[st-1])

Fixed submission:
n,q = map(int,input().split())
s = input()
lr = [0] * (n+1)

for i in range(n):
    lr[i+1] = lr[i]+(1 if s[i:i+2] == "AC" else 0)

for i in range(q):
    st,fn = map(int,input().split())
    print(lr[fn-1] - lr[st-1])

Buggy python submission (verdict: Runtime Error):
n,q = map(int,input().split())
s = list(map(str,input()))
lr = [0] * (n+1)

for i in range(n):
    if s[i] == "A" and s[i+1] == "C":
        lr[i+1] = lr[i]+1
    else:
        lr[i+1] = lr[i]

for i in range(q):
    st,fn = map(int,input().split())
    print(lr[fn-1] - lr[st-1])

Fixed submission:
n,q = map(int,input().split())
s = input()
lr = [0] * (n+1)

for i in range(n):
    lr[i+1] = lr[i]+(1 if s[i:i+2] == "AC" else 0)

for i in range(q):
    st,fn = map(int,input().split())
    print(lr[fn-1] - lr[st-1])

Buggy python submission (verdict: Time Limit Exceeded):
n,q = map(int,input().split())
s = list(map(str,input()))
lr = [0] * (len(s)-1)

for i in range(len(s)-1):
    if s[i] == "A" and s[i+1] == "C":
        lr[i] = 1

for i in range(q):
    st,fn = map(int,input().split())
    tmp = lr[st-1:fn-1]
    print(sum(tmp))

Fixed submission:
n,q = map(int,input().split())
s = input()
lr = [0] * (n+1)

for i in range(n):
    lr[i+1] = lr[i]+(1 if s[i:i+2] == "AC" else 0)

for i in range(q):
    st,fn = map(int,input().split())
    print(lr[fn-1] - lr[st-1])

Buggy python submission (verdict: Time Limit Exceeded):
n,q = map(int,input().split())
s = list(map(str,input()))
lr = [0] * q
for i in range(q):
    lr[i] = list(map(int,input().split()))


for i in range(q):
    ans = 0
    st = lr[i][0]-1
    f = lr[i][1]-1
    for j in range(st,f):
        if s[j] == "A" and s[j+1] == "C":
            ans += 1  
    print(ans)

Fixed submission:
n,q = map(int,input().split())
s = input()
lr = [0] * (n+1)

for i in range(n):
    lr[i+1] = lr[i]+(1 if s[i:i+2] == "AC" else 0)

for i in range(q):
    st,fn = map(int,input().split())
    print(lr[fn-1] - lr[st-1])
Buggy python submission (verdict: Runtime Error):
n,k = map(int,input().split())
l = []
for _ in range(n):
    a = int(input())
    l.append(a)

ans = 10**9
l.sort()
for i in range(n-k+1):
    tmp = max(l[i:k+i]) - min(l[i:k+i])
    if tmp < ans:
        ans = tmp

print(ans)

Fixed submission:
d = int(input())

if d == 22:
    print("Christmas Eve Eve Eve")
elif d == 23:
    print("Christmas Eve Eve")
elif d == 24:
    print("Christmas Eve")
else:
    print("Christmas")
Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(int,input().split())
l = []
for _ in range(n):
    a = int(input())
    l.append(a)

ans = 10**9
l.sort()
for i in range(n-k+1):
    tmp = max(l[i:k+i]) - min(l[i:k+i])
    if tmp < ans:
        ans = tmp

print(ans)

Fixed submission:
n,k = map(int,input().split())
l = []
for _ in range(n):
    a = int(input())
    l.append(a)

ans = 10**9
l.sort()

for i in range(n-k+1):
    tmp = l[k+i-1] - l[i]
    if tmp < ans:
        ans = tmp

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(int,input().split())
l = []
for _ in range(n):
    a = int(input())
    l.append(a)

ans = 10**9
l.sort()
for i in range(n-k+1):
    tmp = max(l[i:k+i]) - min(l[i:k+i])
    if tmp < ans:
        ans = tmp

print(ans)

Fixed submission:
n,k = map(int,input().split())
l = []
for _ in range(n):
    a = int(input())
    l.append(a)

ans = 10**9
l.sort()

for i in range(n-k+1):
    tmp = l[k+i-1] - l[i]
    if tmp < ans:
        ans = tmp

print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
l = list(map(str,input()))

ans = 0
for i in range(n):
    a = l[0:i]
    b = l[i:n-1]
    tmp = []
    for j in a:
        if j in b:
            tmp.append(j)
    tmp = set(tmp)
    ans = (max(ans,len(tmp)))

print(ans)

Fixed submission:
a,b = map(int,input().split())
t = a+b
h = a-b
k = a*b
print(max(t,h,k))
Buggy python submission (verdict: Runtime Error):
import math

x = int(input())
ans = [1]
s = int(math.sqrt(x))
if s >= 2:
    for i in range(2,s+1):
        temp = i
        while True:
            temp *= i
            if temp <= n:
                ans.append(temp)
            else:
                break

print(max(ans))

Fixed submission:
import math

x = int(input())
ans = [1]
s = int(math.sqrt(x))
if s >= 2:
    for i in range(2,s+1):
        temp = i
        while True:
            temp *= i
            if temp <= x:
                ans.append(temp)
            else:
                break

print(max(ans))

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

x = int(input())
ans = [1]
s = math.sqrt(x)
if s >= 2:
    for i in range(2,s+1):
        temp = i
        while True:
            temp *= i
            if temp <= n:
                ans.append(temp)
            else:
                break

print(max(ans))

Fixed submission:
import math

x = int(input())
ans = [1]
s = int(math.sqrt(x))
if s >= 2:
    for i in range(2,s+1):
        temp = i
        while True:
            temp *= i
            if temp <= x:
                ans.append(temp)
            else:
                break

print(max(ans))
Buggy python submission (verdict: Time Limit Exceeded):
import copy

n = int(input())
l = list(map(int,input().split()))
p = n//2

for i in range(n):
    tmp = copy.copy(l)
    tmp[i] = 0
    tmp.sort()
    print(tmp[p])

Fixed submission:
import copy

n = int(input())
l = list(map(int,input().split()))
p1 = n//2
p2 = n//2-1
ans = copy.copy(l)
ans.sort()

for i in l:
    if i >= ans[p1]:
        print(ans[p2])
    else:
        print(ans[p1])
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))
a.append(0)

for i in range(n):
    ans = 0
    s = 0
    for j in range(n+1):
        if j != i:
            ans += abs(s-a[j])
            s = a[j]
    print(ans)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
a = [0] + a + [0]

s = 0

for i in range(n+1):
    s += abs(a[i]-a[i+1])

for i in range(n):
    print(s+abs(a[i]-a[i+2])-(abs(a[i]-a[i+1])+abs(a[i+1]-a[i+2])))
Buggy python submission (verdict: Runtime Error):
import numpy as np
from scipy.special import comb

n = int(input())
a = []
for _ in range(n):
    b = list(map(str,input()))
    a.append(b)

ans = [0]*5

for i in range(n):
    tmp = a[i][0]
    if tmp == "M":
        ans[0] += 1
    elif tmp == "A":
        ans[1] += 1
    elif tmp == "R":
        ans[2] += 1
    elif tmp == "C":
        ans[3] += 1
    elif tmp == "H":
        ans[4] += 1
    else:
        continue

cnt = []
for j in range(len(ans)):
    if ans[j] == 0:
        continue
    else:
        cnt.append(ans[j])
l = 0
for k in range(len(cnt)):
    if cnt[k] > 1:
        l += cnt[k] - 1

cnt.sort()
if len(cnt) <= 2:
    print(0)
elif len(cnt) == 3:
    print(np.prod(cnt))
elif len(cnt) == 4:
    print((cnt[0]*cnt[1]*cnt[2])+(3*cnt[3]))
else:
    print((cnt[0]*cnt[1]*cnt[2])+(3*cnt[3])+(6*cnt[4]))

Fixed submission:
n = int(input())
print(n//3)
Buggy python submission (verdict: Runtime Error):
import numpy as np
from scipy.special import comb

n = int(input())
a = []
for _ in range(n):
    b = list(map(str,input()))
    a.append(b)

ans = [0]*5

for i in range(n):
    tmp = a[i][0]
    if tmp == "M":
        ans[0] += 1
    elif tmp == "A":
        ans[1] += 1
    elif tmp == "R":
        ans[2] += 1
    elif tmp == "C":
        ans[3] += 1
    elif tmp == "H":
        ans[4] += 1
    else:
        continue

cnt = []
for j in range(len(ans)):
    if ans[j] == 0:
        continue
    else:
        cnt.append(ans[j])
l = 0
for k in range(len(cnt)):
    if cnt[k] > 1:
        l += cnt[k] - 1

cnt.sort()
print(cnt)
if len(cnt) <= 2:
    print(0)
elif len(cnt) == 3:
    print(np.prod(cnt))
elif len(cnt) == 4:
    print((cnt[0]*cnt[1]*cnt[2])+(3*cnt[3]))
else:
    print((cnt[0]*cnt[1]*cnt[2])+(3*cnt[3])+(6*cnt[4]))

Fixed submission:
import itertools

n = int(input())
a = []
for _ in range(n):
    b = list(map(str,input()))
    a.append(b)

ans = [0]*5

for i in range(n):
    tmp = a[i][0]
    if tmp == "M":
        ans[0] += 1
    elif tmp == "A":
        ans[1] += 1
    elif tmp == "R":
        ans[2] += 1
    elif tmp == "C":
        ans[3] += 1
    elif tmp == "H":
        ans[4] += 1
    else:
        continue

cnt = 0
for l in itertools.combinations(ans,3):
    cnt += l[0]*l[1]*l[2]

print(cnt)
Buggy python submission (verdict: Runtime Error):
n = int(input())
l = []
for _ in range(3):
    a = list(map(int,input().split()))
    l.append(a)

if n == 1:
    print(l[0][0]+l[1][0])
    exit()
    
m1 = []
m2 = []
m1.append(l[0][0])
m2.append(l[1][0])
for i in range(1,n):
    m1.append(m1[i-1]+l[0][i])
    m2.append(m2[i-1]+l[1][i])

ans = [0]*n
for j in range(n):
    ans[j] = m1[j]+(m2[n-1]-m2[j-1])

print(max(ans))

Fixed submission:
n = int(input())
l = []
for _ in range(2):
    a = list(map(int,input().split()))
    l.append(a)

if n == 1:
    print(l[0][0]+l[1][0])
    exit()

m1 = []
m2 = []
m1.append(0)
m1.append(l[0][0])
m2.append(0)
m2.append(l[1][0])

for i in range(1,n):
    m1.append(m1[i]+l[0][i])
    m2.append(m2[i]+l[1][i])

ans = [0]*n
for j in range(1,n+1):
    ans[j-1] = m1[j]+(m2[n]-m2[j-1])


print(max(ans))
Buggy python submission (verdict: Runtime Error):
n = int(input())
l = [0]*87
l[0] = 2
l[1] = 1

for i in range(2,87):
    tmp = l[i-2] + l[i-1]
    l[i] = tmp

print(l[n])

Fixed submission:
n = list(map(int,input()))
cnt = 0
f = n[0]

for i in range(4):
    if cnt == 3:
        break
    if f == n[i]:
        cnt += 1
        f = n[i]
    else:
        cnt = 0
        f = n[i]
if f == n[i]:
    cnt += 1

if cnt >= 3:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))
l = [0]*n
l[0] = a[0]

for i in range(1,n):
    l[i] = l[i-1] + a[i]

ans = 10**9+1
for i in range(len(l)-1):
    x = l[i]
    y = sum - l[i]
    tmp = abs(x-y)
    ans = min(ans,tmp)

print(ans)


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

for i in range(1,n):
    l[i] = l[i-1] + a[i]
sum = sum(a)
ans = 10**10+1
for i in range(len(l)-1):
    x = l[i]
    y = sum - l[i]
    tmp = abs(x-y)
    ans = min(ans,tmp)

print(ans)
Buggy python submission (verdict: Runtime Error):
a,b,c = map(int,input().split())
cnt = 0

if a == b and a== c and a%2 == 0:
    print(-1)
    exit()

while acnt%2 == 0 and bcnt%2 == 0 and ccnt%2 == 0:
    cnt+=1
    i=a
    j=b
    a=(b+c)//2
    b=(i+c)//2
    c=(i+j)//2

print(cnt)

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

if a == b and a== c and a%2 == 0:
    print(-1)
    exit()

while a%2 == 0 and b%2 == 0 and c%2 == 0:
    cnt+=1
    i=a
    j=b
    a=(b+c)//2
    b=(i+c)//2
    c=(i+j)//2

print(cnt)
Buggy python submission (verdict: Runtime Error):
a,b,c = map(int,input().split())
acnt = 0
bcnt = 0
ccnt = 0
cnt = 0
if a == b and a== c and a%2 == 0:
    print(-1)
    exit()
while a%2 == 0 and b%2 == 0 and c%2 == 0:
    cnt += 1
    acnt = (b+c)//2
    bcnt = (a+c)//2
    ccnt = (a+b)//2
    a = acnt
    b = bcnt 
    c = ccnt
print(cnt)

Fixed submission:
a = list(map(str,input().split()))
ans = []

for i in range(3):
    tmp = list(map(str,a[i]))
    b = tmp[0]
    b = chr(ord(b)-32)
    ans.append(b)

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

f = 0
cnt = 0
if a[0] < a[1]:
    f = 1
elif a[0] > a[1]:
    f = 2
tmp = a[1]

for i in range(2,n):
    if tmp < a[i]:
        if f == 2:
            cnt += 1
            f = 0
        elif f == 0:
            f = 1
    elif tmp > a[i]:
        if f == 1:
            cnt += 1
            f = 0
        elif f == 0:
            f = 2
    tmp = a[i]
cnt += 1

print(cnt)

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

if n <= 2:
    print(1)
    exit()

f = 0
cnt = 0
if a[0] < a[1]:
    f = 1
elif a[0] > a[1]:
    f = 2
tmp = a[1]

for i in range(2,n):
    if tmp < a[i]:
        if f == 2:
            cnt += 1
            f = 0
        elif f == 0:
            f = 1
    elif tmp > a[i]:
        if f == 1:
            cnt += 1
            f = 0
        elif f == 0:
            f = 2
    tmp = a[i]
cnt += 1

print(cnt)

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

f = 0
cnt = 0
if a[0] < a[1]:
    f = 1
elif a[0] > a[1]:
    f = 2
tmp = a[1]

for i in range(2,n):
    if tmp < a[i]:
        if f == 2:
            cnt += 1
            f = 0
        elif f == 0:
            f = 1
    elif tmp > a[i]:
        if f == 1:
            cnt += 1
            f = 0
        elif f == 0:
            f = 2
    else:
        continue
    tmp = a[i]
cnt += 1

print(cnt)

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

if n <= 2:
    print(1)
    exit()

f = 0
cnt = 0
if a[0] < a[1]:
    f = 1
elif a[0] > a[1]:
    f = 2
tmp = a[1]

for i in range(2,n):
    if tmp < a[i]:
        if f == 2:
            cnt += 1
            f = 0
        elif f == 0:
            f = 1
    elif tmp > a[i]:
        if f == 1:
            cnt += 1
            f = 0
        elif f == 0:
            f = 2
    tmp = a[i]
cnt += 1

print(cnt)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
l = []
for i in range(n):
    i = list(map(int,input().split()))
    l.append(i)
tmp = 0

for j in reversed(range(n)):
    l[j][0] += tmp
    while  l[j][0]%l[j][1] != 0:
        l[j][0] += 1
        tmp += 1

print(tmp)

Fixed submission:
n = int(input())
l = []
for i in range(n):
    i = list(map(int,input().split()))
    l.append(i)
tmp = 0

for j in reversed(range(n)):
    l[j][0] += tmp
    if l[j][0]%l[j][1] != 0:
        tmp += l[j][1] - l[j][0]%l[j][1]

print(tmp)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
l = []
for i in range(n):
    i = list(map(int,input().split()))
    l.append(i)
tmp = 0

for j in reversed(range(n)):
    l[j][0] += tmp
    while  l[j][0]%l[j][1] != 0:
        l[j][0] += 1
        tmp += 1

print(tmp)

Fixed submission:
n = int(input())
l = []
for i in range(n):
    i = list(map(int,input().split()))
    l.append(i)
tmp = 0

for j in reversed(range(n)):
    l[j][0] += tmp
    if l[j][0]%l[j][1] != 0:
        tmp += l[j][1] - l[j][0]%l[j][1]

print(tmp)
Buggy python submission (verdict: Time Limit Exceeded):
k,s = map(int,input().split())

ans = 0
for i in range(k+1):
    for j in range(k+1):
        for l in range(k+1):
            if i+j+l == s:
                ans += 1

print(ans)

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

ans = 0
for i in range(k+1):
    for j in range(k+1):
        if 0 <= s-i-j <= k:
            ans += 1

print(ans)