Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
from itertools import accumulate
from collections import Counter
n = int(input())
nums = list(map(int,input().split()))
s = [0]+list(accumulate(nums))
ans = 0
for i in Counter(S).values():
    if i > 1:
        ans += i * (i - 1) // 2
print(ans)

Fixed submission:
from itertools import accumulate
from collections import Counter
n = int(input())
nums = list(map(int,input().split()))
s = [0]+list(accumulate(nums))
ans = 0
for i in Counter(s).values():
    if i > 1:
        ans += i * (i - 1) // 2
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
A = list(map(int,input().split()))
ans = 0
for i in range(n):
    for j in range(i,n):
        if sum(A[i:j+1]) == 0:
            ans += 1
print(ans)


Fixed submission:
from itertools import accumulate
from collections import Counter
n = int(input())
nums = list(map(int,input().split()))
s = [0]+list(accumulate(nums))
ans = 0
for i in Counter(s).values():
    if i > 1:
        ans += i * (i - 1) // 2
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
A = list(map(int,input().split()))
ans = 0
for i in range(n):
    for j in range(i,n):
        if sum(A[i:j+1]) == 0:
            ans += 1
print(ans)

Fixed submission:
from itertools import accumulate
from collections import Counter
n = int(input())
nums = list(map(int,input().split()))
s = [0]+list(accumulate(nums))
ans = 0
for i in Counter(s).values():
    if i > 1:
        ans += i * (i - 1) // 2
print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))
b = tuple(a)
a.sort()
A1 = a[N//2-1]
A2 = a[N//2]
med = (A1+A2)/2
for i in range(N):
    if b[i] <= med:
        print(A2)
    else:
        print(A1)


Fixed submission:
n = int(input())
a = list(map(int,input().split()))
b = tuple(a)
a.sort()
A1 = a[n//2-1]
A2 = a[n//2]
med = (A1+A2)/2
for i in range(n):
    if b[i] <= med:
        print(A2)
    else:
        print(A1)

Buggy python submission (verdict: Time Limit Exceeded):
import statistics
N = int(input())
L = list(map(int,input().split()))
for i in range(N):
    Li = L[0:i] + L [i+1::]
    k = statistics.median(Li)
    print(k)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
b = tuple(a)
a.sort()
A1 = a[n//2-1]
A2 = a[n//2]
med = (A1+A2)/2
for i in range(n):
    if b[i] <= med:
        print(A2)
    else:
        print(A1)
Buggy python submission (verdict: Time Limit Exceeded):
import math
import itertools
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))


n = int(input())
a = list(map(int,input().split()))
a.sort()
#b = list(itertools.combinations(a,2))
ans = [0,(0,0)]
#print(b)
for i in range(n-1):
    tmpans = combinations_count(a[-1],a[i])
    if tmpans >= ans[0]:
        ans = [tmpans,(a[-1],a[i])]
        
print(ans[1][0],ans[1][1])

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
a.sort()
dis = [abs(a[-1]/2 - a[i]) for i in range(n-1)]
r = a[dis.index(min(dis))]
print(a[-1],r)

Buggy python submission (verdict: Time Limit Exceeded):
import math
import itertools
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))


n = int(input())
a = list(map(int,input().split()))
b = list(itertools.combinations(a,2))
ans = [0,(0,0)]
#print(b)
for i in range(len(b)):
    tmpans = combinations_count(max(b[i][0], b[i][1]),min(b[i][0], b[i][1]))
    if tmpans >= ans[0]:
        ans = [tmpans,(max(b[i][0], b[i][1]),min(b[i][0], b[i][1]))]
        
print(ans[1][0],ans[1][1])

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
a.sort()
dis = [abs(a[-1]/2 - a[i]) for i in range(n-1)]
r = a[dis.index(min(dis))]
print(a[-1],r)
Buggy python submission (verdict: Runtime Error):
L = list(map(int,input().split())).sort(reverse=True)
m = (L[0]-L[1]) % 2 - (L[0] - L[2]) % 2
if m == 0:
    print(L[0]+(-L[1]-L[2])//2)
else:
    print(L[0]+(-L[1]-L[2]+3)//2)


Fixed submission:
L = sorted(list(map(int,input().split())),reverse=True)
m = (L[0]-L[1]) % 2 - (L[0] - L[2]) % 2
if m == 0:
    print(L[0]+(-L[1]-L[2])//2)
else:
    print(L[0]+(-L[1]-L[2]+3)//2)
Buggy python submission (verdict: Runtime Error):
n = str(input())
if n == 1:
    print(1)
    exit()
if n[0] == "1":
    tmpint = eval("9"*(len(n)-1))
    #print("tmpint",tmpint)
else:
    tmpint = eval(str(eval(n[0])-1) + "9"*(len(n)-1))
    #print("tmpint",tmpint)
tmpsum = sum([
        eval(str(tmpint)[i]) for i in range(len(str(tmpint)))
    ])
ssum = sum([
        eval(n[i]) for i in range(len(str(n)))
    ])
print(max(tmpsum,ssum))
#print(tmpsum,ssum)

Fixed submission:
n = str(input())
if n == "1":
    print(1)
    exit()
if n[0] == "1":
    tmpint = eval("9"*(len(n)-1))
    #print("tmpint",tmpint)
else:
    tmpint = eval(str(eval(n[0])-1) + "9"*(len(n)-1))
    #print("tmpint",tmpint)
tmpsum = sum([
        eval(str(tmpint)[i]) for i in range(len(str(tmpint)))
    ])
ssum = sum([
        eval(n[i]) for i in range(len(str(n)))
    ])
print(max(tmpsum,ssum))
#print(tmpsum,ssum)

Buggy python submission (verdict: Runtime Error):
n = str(input())
if n[0] == "1":
    tmpint = eval("9"*(len(n)-1))
    #print("tmpint",tmpint)
else:
    tmpint = eval(str(eval(n[0])-1) + "9"*(len(n)-1))
    #print("tmpint",tmpint)
tmpsum = sum([
        eval(str(tmpint)[i]) for i in range(len(str(tmpint)))
    ])
ssum = sum([
        eval(n[i]) for i in range(len(str(n)))
    ])
print(max(tmpsum,ssum))
#print(tmpsum,ssum)

Fixed submission:
n = str(input())
if n == "1":
    print(1)
    exit()
if n[0] == "1":
    tmpint = eval("9"*(len(n)-1))
    #print("tmpint",tmpint)
else:
    tmpint = eval(str(eval(n[0])-1) + "9"*(len(n)-1))
    #print("tmpint",tmpint)
tmpsum = sum([
        eval(str(tmpint)[i]) for i in range(len(str(tmpint)))
    ])
ssum = sum([
        eval(n[i]) for i in range(len(str(n)))
    ])
print(max(tmpsum,ssum))
#print(tmpsum,ssum)
Buggy python submission (verdict: Runtime Error):
x = int(input())
y = int(input())
z = int(input())
s = int(input())
a = 0
for i in range(x+1):
    for j in range(y+1):
        for k in range(z+1):
            if 500*i+100*j+50*k == s:
                a = a+1
print(a)


Fixed submission:
X = int(input())
X = X - int(input())
print(X % int(input()))

Buggy python submission (verdict: Runtime Error):
x = int(input())
y = int(input())
z = int(input())

s = int(input())

a = 0
for i in range(x+1):
    for j in range(y+1):
        for k in range(z+1):
            if 500*x+100*y+50*z == s:
                a = a+1


print(a)


Fixed submission:
X = int(input())
X = X - int(input())
print(X % int(input()))
Buggy python submission (verdict: Runtime Error):
x = int(input())
y = int(input())
z = int(input())

s = int(input())

a = 0
for i in range(x+1):
    for j in range(y+1):
        for k in range(z+1):
            if 500*x+100*y+50*z == s
                a = a+1


print(a)


Fixed submission:
x = int(input())
y = int(input())
z = int(input())
s = int(input())
a = 0
for i in range(x+1):
    for j in range(y+1):
        for k in range(z+1):
            if 500*i+100*j+50*k == s:
                a = a+1
print(a)
Buggy python submission (verdict: Runtime Error):
n,h = map(int,input().split())
A = []
B = []
for i in range(n):
    a,b = map(int,input().split())
    A.append(a)
    B.append(b)
A.sort(reverse=True)
B.sort(reverse=True)
B = [ i for i in B if i > A[0] ]
ans = 0
for i in B:
    ans += 1
    h -= i
    if h < 0:
        break
if h > 0:
    if h % A[0] == 0:
        ans += h // A[0]
    else:
        ans += h // A[0] + 1
print(ans)

Fixed submission:
S = str(input())
print(S[0:3]+"8"+S[4:])

Buggy python submission (verdict: Runtime Error):
S = str(input())
S[3]="8"
print(S)

Fixed submission:
S = str(input())
print(S[0:3]+"8"+S[4:])
Buggy python submission (verdict: Runtime Error):
A,B = map(int,input().split())
S = str(input())
if len(S) > A+B+1:
        print("No1")
        exit()
if len(S[A+1:]) != B:
        print("No2")
        exit()
if S == S[0:A]+"-"+S[A+1:] and "-" not in S[0:A] and "-" not in S[A+1:] :
        print("Yes")
else:
        print("No")



Fixed submission:
N = int(input())
print(48-N)
Buggy python submission (verdict: Runtime Error):
A,B,C,D =　map(int,input().split())
if A+B > C+D:
  print("Left")
elif A+B == C+D:
  print("Blanced")
else:
  print("Right")

Fixed submission:
A,B,C,D = map(int,input().split())
E = A+B
F = C+D
if E > F:
  print("Left")
elif E == F:
  print("Balanced")
else:
  print("Right")

Buggy python submission (verdict: Runtime Error):
A,B,C,D =　map(int,input().split())
if A+B > C+D:
  print("Left")
elif A+B == C+D:
  print("Blanced")
else:
  print("Right")

Fixed submission:
A,B,C,D = map(int,input().split())
E = A+B
F = C+D
if E > F:
  print("Left")
elif E == F:
  print("Balanced")
else:
  print("Right")

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = int(input())
B = int(input())

i = 0
for k in range(N +1):
    if A <= sum( [int(s) for s in str(k)] ) <= B:
        i = i+1
print(i)

Fixed submission:
A,B,C,D = map(int,input().split())
E = A+B
F = C+D
if E > F:
  print("Left")
elif E == F:
  print("Balanced")
else:
  print("Right")
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = int(input())
B = int(input())

i = 0
for i in range(N +1):
    if A <= sum( [int(s) for s in str(i)] ) <= B:
        i = i+1
print(i)

Fixed submission:
n, a, b = map(int, input().split())
c = 0
for i in range(n+1):
    if a <= sum(list(map(int, list(str(i))))) <= b:
        c += i
print(c)

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = int(input())
B = int(input())

i = 0
for i in range(N +1)
    if A <= sum( [int(s) for s in str(i)] ) <= B:
        i = i+1
print(i)

Fixed submission:
n, a, b = map(int, input().split())
c = 0
for i in range(n+1):
    if a <= sum(list(map(int, list(str(i))))) <= b:
        c += i
print(c)
Buggy python submission (verdict: Runtime Error):
s = str(input())
s = sorted([s[i] for i in range(len(s))])
t = str(input())
t = sorted([t[i] for i in range(len(t))],reverse=True)

if len(t) < len(s):
    for i in range(len(t)):
        if s[i] == t[i]:
            i += 1
        if s[i] < t[i]:
            print("Yes")
            exit()
    print("No")
else:
    s = sorted(s,reverse=True)
    for i in range(len(s)):
        if s[i] > t[i]:
            print("No")
            exit()
    print("Yes")

Fixed submission:
s=" ".join(sorted(input()))
t=" ".join(sorted(input(),reverse=True))
if s<t:print("Yes")
else:print("No")

Buggy python submission (verdict: Runtime Error):
s = str(input())
s = sorted([s[i] for i in range(len(s))])
t = str(input())
t = sorted([t[i] for i in range(len(t))],reverse=True)

if len(t) < len(s):
    for i in range(len(t)):
        if s[i] == t[i]:
            i += 1
        if s[i] < t[i]:
            print("Yes")
            exit()
    print("No")
else:
    s = sorted(s,reverse=True)
    for i in range(len(s)):
        if s[i] > t[i]:

            print("No")
            exit()

    print("Yes")

Fixed submission:
s=" ".join(sorted(input()))
t=" ".join(sorted(input(),reverse=True))
if s<t:print("Yes")
else:print("No")
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
L = list(map(int,input().split()))
j = set(L)
ans = 0
for i in j:
    if L.count(i) >= i:
        ans += L.count(i) - i
    else:
        ans += L.count(i)
print(ans)

Fixed submission:
import collections
input()
c = collections.Counter(list(map(int,input().split())))
ans = 0
for i,j in c.items():
        if j >= i:
            ans += j - i
        else:
            ans += j
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
L = list(map(int,input().split()))
j = set(L)
ans = 0
for i in j:
    if L.count(i) >= i:
        ans += (L.count(i) - i)
    else:
        ans += L.count(i)
print(ans)

Fixed submission:
import collections
input()
c = collections.Counter(list(map(int,input().split())))
ans = 0
for i,j in c.items():
        if j >= i:
            ans += j - i
        else:
            ans += j
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline
n,k = map(int, input().split())
num = list(map(int, input().split()))
cns = set(num)
f = [num.count(i) for i in cns]
f.sort(reverse=True)
print(sum(f[k::]))

Fixed submission:
import sys
input = sys.stdin.readline
import collections
n,k = map(int, input().split())
num = list(map(int, input().split()))
cns = collections.Counter(num)
f = [cns[i] for i in cns]
f.sort(reverse=True)
print(sum(f[k::]))

Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline
N, K = map(int, input().split())
num = list(map(int, input().split()))
cns = set(num)
f = []
for i in cns:
    f.append(num.count(i))
f.sort(reverse=True)
print(sum(f[K::]))

Fixed submission:
import sys
input = sys.stdin.readline
import collections
n,k = map(int, input().split())
num = list(map(int, input().split()))
cns = collections.Counter(num)
f = [cns[i] for i in cns]
f.sort(reverse=True)
print(sum(f[k::]))

Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline
N, K = map(int, input().split())
num = list(map(int, input().split()))
cns = list(set(num))
f = []
for i in cns:
    f.append(num.count(i))
f.sort(reverse=True)
print(sum(f[K::]))

Fixed submission:
import sys
input = sys.stdin.readline
import collections
n,k = map(int, input().split())
num = list(map(int, input().split()))
cns = collections.Counter(num)
f = [cns[i] for i in cns]
f.sort(reverse=True)
print(sum(f[k::]))
Buggy python submission (verdict: Runtime Error):
N = int(input())
S = str(N)

f = 0
for i in range(len(N)):
    f += int(S[i])
if N % f == 0:
    print("Yes")
else:
    print("No")

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

f = 0
for i in range(len(S)):
    f += int(S[i])
if N % f == 0:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
S = str(input())
N = int(input())
q = (N -1) // 5
mod = N % 5

    print(S[q]+S[mod-1])


Fixed submission:
S = str(input())
if S[0] == S[1] == S[2] or S[1] == S[2] == S[3]:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
S = str(input())
N = int(input())
q = (N -1) // 5
mod = N % 5
if N == 25:
    print(S[4]+S[4])
else:
    print(S[q]+S[mod-1])


Fixed submission:
S = str(input())
if S[0] == S[1] == S[2] or S[1] == S[2] == S[3]:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline
n,m = map(int, input().split())
print((1900*m + 100*(n − m))*2**m)

Fixed submission:
import sys
input = sys.stdin.readline
n,m = map(int, input().split())
print((1900*m + 100*(n - m))*2**m)

Buggy python submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline
n,m = map(int, input().split())
print((1900*m + 100(N − M))*2**m)

Fixed submission:
import sys
input = sys.stdin.readline
n,m = map(int, input().split())
print((1900*m + 100*(n - m))*2**m)
Buggy python submission (verdict: Runtime Error):
n = int(input())
for i in range(n+1):
    if i**2 > n:
        print((i-1)**2)
        exit()

Fixed submission:
S = str(input())
s = str(input())
if S[0] == s[2] and S[1] == s[1] and S[2] == s[0]:
    print("YES")
else:
    print("NO")
Buggy python submission (verdict: Runtime Error):
R = int(input())
G = int(input())
P = 2G-R
print(P)


Fixed submission:
R = int(input())
G = int(input())
P = 2*G-R
print(P)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
D = list(map(int,input().split()))
m = int(input())
T = list(map(int,input().split()))
for i in range(m):
    if T[i] in D:
        del D[D.index(T[i])]
    else:
        print("NO")
        exit()
print("YES")

Fixed submission:
import collections
n = int(input())
d = list(map(int, input().split()))
m = int(input())
t = list(map(int, input().split()))
dc = collections.Counter(d)
tc = collections.Counter(t)
for i in tc:
    if tc[i] > dc[i]:
        print("NO")
        exit()
print("YES")
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
for h in range(1,3501):
    for n in range(1,3501):
        try:
            tmp = n*h*N / ( 4*h*n - N*n - N* h)
        except:
            continue
        if tmp == tmp//1 and tmp > 0:
            print(h,n,int(tmp))
            exit()

Fixed submission:
N = int(input())
for h in range(1,3501):
    for n in range(1,3501):
        try:
            tmp = n*h*N / ( 4*h*n - N*n - N* h)
        except:
            continue
        if tmp == tmp//1 and tmp > 0:
            print(h,n,int(tmp))
            exit()
Buggy python submission (verdict: Runtime Error):
n,m,k = map(int, input().split())
for i in range(n + 1):
    for j in range(m + 1):
        if i*(m - j) + j*(n - i) == k:
            print("Yes")
            exit()
print("No")


Fixed submission:
s = str(input())
if s[0:4] == "YAKI":
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
A = [int(input()) for i in range(n)]
ans = 0
for i in A:
    if A.count(i) % 2 != 0:
        ans += 1
print(ans)

Fixed submission:
n = int(input())
s = set()
for i in range(n):
    k = int(input())
    if k in s:
        s.remove(k)
    else:
        s.add(k)
print(len(s))

Buggy python submission (verdict: Time Limit Exceeded):
import hashlib
n = int(input())
A = [int(input()) for i in range(n)]
a = set(A)
ans = len(a)
for i in a:
    if A.count(i) % 2 == 0:
        ans -= 1
print(ans)

Fixed submission:
n = int(input())
s = set()
for i in range(n):
    k = int(input())
    if k in s:
        s.remove(k)
    else:
        s.add(k)
print(len(s))

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
A = []
for i in range(n):
    k = int(input())
    if k in A:
        del A[A.index(k)]
    else:
        A.append(k)
print(len(A))

Fixed submission:
n = int(input())
s = set()
for i in range(n):
    k = int(input())
    if k in s:
        s.remove(k)
    else:
        s.add(k)
print(len(s))

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
A = []
for i in range(n):
    k = int(input())
    if k in A:
        del A[A.index(k)]
    else:
        A.append(k)
print(len(A))

Fixed submission:
n = int(input())
s = set()
for i in range(n):
    k = int(input())
    if k in s:
        s.remove(k)
    else:
        s.add(k)
print(len(s))
Buggy python submission (verdict: Runtime Error):
import statistics
n = int(input())
A = list(map(int,input().split()))
B = [A[i]-1 for i in range(n)] +  A + [A[i]+1 for i in range(n)]
ans = statistics.mode(B)
print(B.count(ans))

Fixed submission:
from collections import Counter
n = int(input())
A = list(map(int,input().split()))
B = [A[i]-1 for i in range(n)] +  A + [A[i]+1 for i in range(n)]
ans = Counter(B).most_common()[0][0]
print(B.count(ans))
Buggy python submission (verdict: Runtime Error):
n = int(input())
A = list(map(int, input().split()))
a = list(set(A))
a.sort(reverse = True)
B = []
for i in a:
    if A.count(i) >= 2:
        B.append(i)
if len(B) <= 1:
    print(0)
else:
    print(B[0]*B[1])

Fixed submission:
x,a,b = map(int,input().split())
if abs(x-a) < abs(x-b):
    print("A")
else:
    print("B")
Buggy python submission (verdict: Runtime Error):
ソースコード 拡げる

Copy
Copy
N = int(input())
count = 0
for i in range(N):
    c = 2**count
    if c > N:
        print(c//2)
        exit()
    else:
        count +=1

Fixed submission:
c = str(input())
print("ABC"+c)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
l = list(map(int,input().split()))
suml = sum(l)
ans = float('Inf')
for i in range(1,n):
    x = sum(l[:i])
    j = abs(2*x - suml)
    ans = min(ans,j)
print(ans)

Fixed submission:
from itertools import accumulate
n = int(input())
l = list(map(int,input().split()))
suml = sum(l)
accl = list(accumulate([0]+l))
ans = float('Inf')
for i in range(1,n):
    x = accl[i]
    j = abs(2*x - suml)
    ans = min(ans,j)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
l = list(map(int,input().split()))
suml = sum(l)
xs = set()
for i in range(2**n):
    x = []
    for j in range(n):
        if ((i >> j) & 1):
            x.append(l[j])
    xs.add(abs(2*sum(x) - suml))
try:
    xs.remove(0)
except:
    pass
ans = min(xs)
print(ans)

Fixed submission:
from itertools import accumulate
n = int(input())
l = list(map(int,input().split()))
suml = sum(l)
accl = list(accumulate([0]+l))
ans = float('Inf')
for i in range(1,n):
    x = accl[i]
    j = abs(2*x - suml)
    ans = min(ans,j)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
l = list(map(int,input().split()))
suml = sum(l)
xs = set()
for i in range(2**n):
    x = []
    for j in range(n):
        if ((i >> j) & 1):
            x.append(l[j])
    xs.add(sum(x))
xs.remove(0)
ans = float('Inf')
for i in xs:
    j = abs(2*i - suml)
    ans = min(ans,j)
print(ans)

Fixed submission:
from itertools import accumulate
n = int(input())
l = list(map(int,input().split()))
suml = sum(l)
accl = list(accumulate([0]+l))
ans = float('Inf')
for i in range(1,n):
    x = accl[i]
    j = abs(2*x - suml)
    ans = min(ans,j)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))
ans = []
for num in a:
    ans.append(num)
    ans.reverse()
print(*ans)

Fixed submission:
import sys
input = sys.stdin.readline
n = int(input())
A = list(map(int,input().split()))
A2 = [A[i] for i in range(1,n,2)]
A0 = [A[i] for i in range(0,n,2)]
if len(A) == 1:
    ans = A
else:
    ans = A0[::-1]
    ans += A2
if n % 2 == 0:
    ans = ans[::-1]
print(*ans)
Buggy python submission (verdict: Runtime Error):
n,a,b = map(int,input().split())
if a > b:
    print(0)
elif a == b:
    print(1)
else:
    print((n - 2) * (b - a) + 1))

Fixed submission:
n,a,b = map(int,input().split())
print(max(0,(n - 2) * (b - a) + 1))

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

Fixed submission:
n,a,b = map(int,input().split())
print(max(0,(n - 2) * (b - a) + 1))
Buggy python submission (verdict: Runtime Error):
N,M = map(int,input().split())
print("#"*(N+2))
for i in range(M):
    print("#"+str(input())+"#")
print("#"*(N+2))


Fixed submission:
N,M = map(int,input().split())
print("#"*(M+2))
for i in range(N):
    print("#"+str(input())+"#")
print("#"*(M+2))
Buggy python submission (verdict: Runtime Error):
a,b,c = map(int,input().split())
if a == b and b == c:
    print(-1)
else:
    ans = 0
    while True:
        if a % 2 == 0 and b % 2 -= 0 and c % 2 == 0:
            ans += 1
            A = b / 2 + c / 2
            B = c / 2 + a / 2
            C = a / 2 + b / 2
            a = A
            b = B
            c = C
        else:
            break
    print(ans)

Fixed submission:
a,b,c = map(int,input().split())
if a == b and b == c:
    if a % 2 == 0 and b % 2 == 0 and c % 2 == 0:
        print(-1)
    else:
        print(0)
else:
    ans = 0
    while True:
        if a % 2 == 0 and b % 2 == 0 and c % 2 == 0:
            ans += 1
            A = b / 2 + c / 2
            B = c / 2 + a / 2
            C = a / 2 + b / 2
            a = A
            b = B
            c = C
        else:
            break
    print(ans)