Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
l  = []

for i in range(N):
	a = int(input())
	l.append(a)

for i in range(N):
	b = l.pop(0)
	print(max(l))
	l.append(b)

Fixed submission:
N = int(input())
l  = []

for i in range(N):
	a = int(input())
	l.append(a)

l_max = max(l)
max_index = l.index(max(l))

for i in range(N):
	if i == max_index:
		b = l.pop(i)
		print(max(l))
	else:
		print(l_max)
Buggy python submission (verdict: Time Limit Exceeded):
L, R = map(int, input().split())
min = 2019

for i in range(L, R+1):
	if min == 0:
		break
	for j in range(i+1, R+1):
		num = i * j % 2019
		if j > i and num < min:
			min = num

print(min)

Fixed submission:
L, R = map(int, input().split())
min = 2019

if R -L >= 2019:
	min = 0
else:

	for i in range(L, R+1):
		for j in range(i+1, R+1):
			num = i * j % 2019
			if j > i and num < min:
				min = num

print(min)

Buggy python submission (verdict: Time Limit Exceeded):
L, R = map(int, input().split())
min = 2019

for i in range(L, R+1):
	if i % 2019 == 0:
		min = 0
		break
	if min == 0:
		break
	for j in range(i+1, R+1):
		if i % 673 == 0 and j % 3 == 0:
			min = 0
			break 
		num = i * j % 2019
		if j > i and num < min:
			min = num

print(min)

Fixed submission:
L, R = map(int, input().split())
min = 2019

if R -L >= 2019:
	min = 0
else:

	for i in range(L, R+1):
		for j in range(i+1, R+1):
			num = i * j % 2019
			if j > i and num < min:
				min = num

print(min)

Buggy python submission (verdict: Time Limit Exceeded):
L, R = map(int, input().split())
min = 2019

for i in range(L, R+1):
	if min == 0:
		break
	for j in range(i+1, R+1):
		num = i * j % 2019
		if j > i and num < min:
			min = num

print(min)

Fixed submission:
L, R = map(int, input().split())
min = 2019

if R -L >= 2019:
	min = 0
else:

	for i in range(L, R+1):
		for j in range(i+1, R+1):
			num = i * j % 2019
			if j > i and num < min:
				min = num

print(min)

Buggy python submission (verdict: Time Limit Exceeded):
L, R = map(int, input().split())
min = 2019

for i in range(L, R+1):
	if i % 2019 == 0:
		min = 0
	if min == 0:
		break
	for j in range(i+1, R+1):
		num = i * j % 2019
		if j > i and num < min:
			min = num

print(min)

Fixed submission:
L, R = map(int, input().split())
min = 2019

if R -L >= 2019:
	min = 0
else:

	for i in range(L, R+1):
		for j in range(i+1, R+1):
			num = i * j % 2019
			if j > i and num < min:
				min = num

print(min)

Buggy python submission (verdict: Time Limit Exceeded):
L, R = map(int, input().split())
min = 2019

for i in range(L, R+1):
	if (i % 2019 == 0):
		min = 0
		break
	for j in range(i+1, R+1):
		num = i * j % 2019
		if j > i and num < min:
			min = num

print(min)

Fixed submission:
L, R = map(int, input().split())
min = 2019

if R -L >= 2019:
	min = 0
else:

	for i in range(L, R+1):
		for j in range(i+1, R+1):
			num = i * j % 2019
			if j > i and num < min:
				min = num

print(min)
Buggy python submission (verdict: Time Limit Exceeded):
R, G, B, N = map(int, input().split())
cnt = 0

for r in range(N//R+1):
	for g in range((N-R*r)//G+1):
		b = (N - R * r - G * g) / B
		if b.is_integer() and b >= 0:
			cnt += 1
print(cnt)


Fixed submission:
R, G, B, N = map(int, input().split())
cnt = 0

for r in range(N//R+1):
	for g in range((N-R*r)//G+1):
		if (N - R * r - G * g) % B == 0:
			cnt += 1
print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
R, G, B, N = map(int, input().split())
cnt = 0

for r in range(N//R+1):
	for g in range(N+1):
		b = (N - R * r - G * g) / B
		if b.is_integer() and b >= 0:
			cnt += 1
print(cnt)

Fixed submission:
R, G, B, N = map(int, input().split())
cnt = 0

for r in range(N//R+1):
	for g in range((N-R*r)//G+1):
		if (N - R * r - G * g) % B == 0:
			cnt += 1
print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
R, G, B, N = map(int, input().split())
cnt = 0

for r in range(N//R+1):
	for g in range(N+1):
		#b = (N - R * r - G * g) / B
		if R * r + G * g == N:
			cnt += 1
		elif ((N - R * r - G * g) / B).is_integer() and ((N - R * r - G * g) / B) > 0:
			cnt += 1
print(cnt)


Fixed submission:
R, G, B, N = map(int, input().split())
cnt = 0

for r in range(N//R+1):
	for g in range((N-R*r)//G+1):
		if (N - R * r - G * g) % B == 0:
			cnt += 1
print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
R, G, B, N = map(int, input().split())
cnt = 0

for r in range(N//R+1):
	for g in range(N+1):
		if R * r + G * g == N:
			cnt += 1
		b = (N - R * r - G * g) / B
		if b.is_integer() and b > 0:
			cnt += 1
print(cnt)


Fixed submission:
R, G, B, N = map(int, input().split())
cnt = 0

for r in range(N//R+1):
	for g in range((N-R*r)//G+1):
		if (N - R * r - G * g) % B == 0:
			cnt += 1
print(cnt)
Buggy python submission (verdict: Time Limit Exceeded):
from functools import reduce

def gcd_base(x, y):
    if x >= y:
        while y != 0:
            x, y = y, x % y
        return x
    else:
        while x != 0:
            y, x = x, y % x
        return y

def gcd(numbers):
    return reduce(gcd_base, numbers)

N = int(input())
A = list(map(int, input().split()))
GCD = []

for i in range(N):
    a = A.pop(0)
    GCD.append(gcd(A))
    A.append(a)

print(max(GCD))

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

N = int(input())
A = list(map(int, input().split()))
L = [0, 0]
for ai in A:
    L.append(gcd(L[-1], ai))
 
R = [0, 0]
for ai in A[::-1]:
    R.append(gcd(R[-1], ai))
 
print(max(gcd(l, r) for l, r in zip(L, reversed(R))))

Buggy python submission (verdict: Runtime Error):
from functools import reduce

def gcd_base(x, y):
    if x >= y:
        while y != 0:
            x, y = y, x % y
        return x
    else:
        while x != 0:
            y, x = x, y % x
        return y

def gcd(numbers):
    return reduce(gcd_base, numbers)

N = int(input())
A = list(map(int, input().split()))
GCD = []

for i in range(N):
    GCD.append(gcd(A[:i]))
    A.append(a)

print(max(GCD))

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

N = int(input())
A = list(map(int, input().split()))
L = [0, 0]
for ai in A:
    L.append(gcd(L[-1], ai))
 
R = [0, 0]
for ai in A[::-1]:
    R.append(gcd(R[-1], ai))
 
print(max(gcd(l, r) for l, r in zip(L, reversed(R))))

Buggy python submission (verdict: Time Limit Exceeded):
from functools import reduce

def gcd_base(x, y):
    if x >= y:
        while y != 0:
            x, y = y, x % y
        return x
    else:
        while x != 0:
            y, x = x, y % x
        return y

def gcd(numbers):
    return reduce(gcd_base, numbers)

N = int(input())
A = list(map(int, input().split()))
GCD = []

for i in range(0, N):
    a = A.pop(0)
    GCD.append(gcd(A))
    A.append(a)

GCD.sort()

print(GCD[N-1])

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

N = int(input())
A = list(map(int, input().split()))
L = [0, 0]
for ai in A:
    L.append(gcd(L[-1], ai))
 
R = [0, 0]
for ai in A[::-1]:
    R.append(gcd(R[-1], ai))
 
print(max(gcd(l, r) for l, r in zip(L, reversed(R))))
Buggy python submission (verdict: Time Limit Exceeded):
import math

def main():
    N = int(input())
    dam_list  = list(map(int, input().split(" ")))
    water_list = []

    for i in range(N):
        sign = 1
        total = 0
        for j in range(i, N+i):
            if j >= N:
                j = j-N
            total = total + dam_list[j] * sign
            sign = sign * -1
        print(total, end=" ")
    
    return


if __name__ == '__main__':
    main()


Fixed submission:
import math

def main():
    N = int(input())
    dam_list  = list(map(int, input().split(" ")))
    water_list = [0 for i in range(N)]
    upstream = dam_list[N-1]
    downstream = 0
    
    for i in range(N):
        water_list[N-1-i] = water_list[N-1-i] + upstream
        water_list[i] = water_list[i] + downstream

        if i == N-1:
            break

        upstream = upstream * -1 + dam_list[N-1 - (i+1)]
        downstream = downstream * -1 + dam_list[i]

    for i in water_list:
        print(i, end=" ")
    return


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
import math

def count(n, A, B):
    n_upper = int(B/n)
    n_lower = int(A/n + 1)
    n_count = n_upper - n_lower + 1
    return n_count

def main():
    A, B, C ,D  = list(map(int, input().split(" ")))
    C_count = count(C, A, B)
    D_count = count(D, A, B)
    s = int((C / math.gcd(C, D)) * D)
    CD_count = count(s, A ,B)
    fcount = (B - A + 1) - (C_count + D_count - CD_count)
    print(fcount)

if __name__ == '__main__':
    main()


Fixed submission:
import math
from fractions import gcd

def count(n, A, B):
    n_upper = B // n
    n_lower = (A-1) // n
    n_count = n_upper - n_lower
    return n_count

def main():
    A, B, C ,D  = list(map(int, input().split(" ")))
    C_count = count(C, A, B)
    D_count = count(D, A, B)
    s = (C * D) // gcd(C, D)
    CD_count = count(s, A ,B)
    fcount = (B - A + 1) - (C_count + D_count - CD_count)
    print(fcount)

if __name__ == '__main__':
    main()

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

def count(n, A, B):
    n_upper = int(B/n)
    n_lower = int(A/n + 1)
    n_count = n_upper - n_lower + 1
    return n_count

def main():
    A, B, C ,D  = list(map(int, input().split(" ")))
    C_count = count(C, A, B)
    D_count = count(D, A, B)
    s = (C / math.gcd(C, D)) * D
    CD_count = count(s, A ,B)
    fcount = (B - A + 1) - (C_count + D_count - CD_count)
    print(fcount)

if __name__ == '__main__':
    main()


Fixed submission:
import math
from fractions import gcd

def count(n, A, B):
    n_upper = B // n
    n_lower = (A-1) // n
    n_count = n_upper - n_lower
    return n_count

def main():
    A, B, C ,D  = list(map(int, input().split(" ")))
    C_count = count(C, A, B)
    D_count = count(D, A, B)
    s = (C * D) // gcd(C, D)
    CD_count = count(s, A ,B)
    fcount = (B - A + 1) - (C_count + D_count - CD_count)
    print(fcount)

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
value_list = []

for i in range(n):
    value_list.append(int(input()))

most_max = max(value_list)

for i in range(n):
    if value_list[i] == most_max:
        value_list[i] = 0
        print(max(value_list))
        value_list[i] = most_max
    else:
        print(most_max)

Fixed submission:
n = int(input())
value_list = []

for i in range(n):
    value_list.append(int(input()))

most_max = max(value_list)

if len([i for i, x in enumerate(value_list) if x == most_max]) == 2:
    for i in range(n):
        print(most_max)
else:
    most_max_index = value_list.index(most_max)
    value_list[most_max_index] = 0
    second_max = max(value_list) 
    value_list[most_max_index] = most_max
    
    for i in range(n):
        if value_list[i] == most_max:
            print(second_max)
        else:
            print(most_max)

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

n = int(input())
value_list = []

for i in range(n):
    value_list.append(int(input()))

for i in range(n):
    keep_list = copy.copy(value_list)
    keep_list[i] = 0
    print(max(keep_list))

Fixed submission:
n = int(input())
value_list = []

for i in range(n):
    value_list.append(int(input()))

most_max = max(value_list)

if len([i for i, x in enumerate(value_list) if x == most_max]) == 2:
    for i in range(n):
        print(most_max)
else:
    most_max_index = value_list.index(most_max)
    value_list[most_max_index] = 0
    second_max = max(value_list) 
    value_list[most_max_index] = most_max
    
    for i in range(n):
        if value_list[i] == most_max:
            print(second_max)
        else:
            print(most_max)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())

s = input()

sum_list = []

for i in range(n):
    if i == 0:
        sum_list.append(s[i + 1:].count('E'))
    elif i == n - 1:
        sum_list.append(s[:i].count('W'))
    else:
        sum_list.append(s[:i].count('W') + s[i + 1:].count('E'))

print(min(sum_list))

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

current_and_left_w=0
ans=current_and_right_e=S.count("E")

for i in S:
    if i=="E":
        current_and_right_e-=1
    else: 
        current_and_left_w+=1
        
    ans=min(ans,current_and_right_e+current_and_left_w)
print(ans)
Buggy python submission (verdict: Runtime Error):
l,r = map(int, input().split())
gap = r-l

vlist = []
mini = 2019
xlist = []

for x in range(gap+1):
    v = (l+x) % 2019
    vlist.append(v)

mini = min(vlist)
for x in vlist:
    if v <= mini+1:
        xlist.append(x)
        

xlist.sort()
#print(vlist)

#res = i*j % 2019
print((vlist[0]*vlist[1])%2019)

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

train = n*a
taxi = b
print(min(train,taxi))
Buggy python submission (verdict: Runtime Error):
l,r = map(int, input().split())
gap = r-l

vlist = []
mini = 2019
xlist = []

for x in range(gap+1):
    v = (l+x) % 2019
    vlist.append(v)

mini = min(vlist)
for x in vlist:
    if v <= mini+1:
        xlist.append(x)
        

xlist.sort()
#print(vlist)

#res = i*j % 2019
print((xlist[0]*xlist[1])%2019)

Fixed submission:
l,r = map(int, input().split())
gap = r-l
 
vlist = []
mini = 2019
 
for x in range(gap+1):
    v = (l+x) % 2019
    vlist.append(v)
    if v == 0:
        print(0)
        exit()
 
vlist.sort()

mini = 2019

for i in vlist:
    for j in vlist:
        if i==j:
            pass
        else:
            temp = (i*j) %2019
            mini = min(temp, mini)
            if mini == 0:
                print(0)
                exit()

print(mini)
    
#print((vlist[0]*vlist[1])%2019)
#print((vlist[0]*vlist[1])%2019)

Buggy python submission (verdict: Runtime Error):
l,r = map(int, input().split())
gap = r-l

vlist = []

    v = (l+x) % 2019
    vlist.append(v)

vlist.sort()
#print(vlist)

#res = i*j % 2019
print(vlist[0]*vlist[1])

Fixed submission:
l,r = map(int, input().split())
gap = r-l
 
vlist = []
mini = 2019
 
for x in range(gap+1):
    v = (l+x) % 2019
    vlist.append(v)
    if v == 0:
        print(0)
        exit()
 
vlist.sort()

mini = 2019

for i in vlist:
    for j in vlist:
        if i==j:
            pass
        else:
            temp = (i*j) %2019
            mini = min(temp, mini)
            if mini == 0:
                print(0)
                exit()

print(mini)
    
#print((vlist[0]*vlist[1])%2019)
#print((vlist[0]*vlist[1])%2019)

Buggy python submission (verdict: Runtime Error):
l,r = map(int, input().split())
gap = r-l

vlist = []

    v = (l+x) % 2019
    vlist.append(v)

vlist.sort()
print(vlist)

#res = i*j % 2019
print(vlist[0]*vlist[1])

Fixed submission:
l,r = map(int, input().split())
gap = r-l
 
vlist = []
mini = 2019
 
for x in range(gap+1):
    v = (l+x) % 2019
    vlist.append(v)
    if v == 0:
        print(0)
        exit()
 
vlist.sort()

mini = 2019

for i in vlist:
    for j in vlist:
        if i==j:
            pass
        else:
            temp = (i*j) %2019
            mini = min(temp, mini)
            if mini == 0:
                print(0)
                exit()

print(mini)
    
#print((vlist[0]*vlist[1])%2019)
#print((vlist[0]*vlist[1])%2019)
Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())

A, B = map(int, input().split())

for i in range(M-1):
    A2, B2 = map(int, input().split())

    if (A < A2 and B2 < A) or (B < A2 and B< B2):
        A = 0
        B = 0
    if (A2 <= A and B <= B2):
        pass
    elif (A2 <= A and A <= B):
        B = B2

    elif (A2 <= B and B <= B2):
        A = A2
    else:
        A = A2
        B = B2


if (B-A) <= 0:
  print(0)
else:
  print(B-A+1)

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

if A >= 13:
    print(B)
elif 13 > A >= 6:
    print(int(B/2))
else:
    print(0)
Buggy python submission (verdict: Runtime Error):
import fractions
from functools import reduce
import copy

def gcd(*numbers):
    return reduce(fractions.gcd, numbers)

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

#in
n=int(input())
v=list(map(int, input().split()))

maxi = 0

# おなじか？
if len(list(set(v))) == 1:
    maxi = (v[0])
elif len(v) == 2:
    maxi = (max(v))
# 書き換え 1
else:
    for i in range(n):
        listv = []
        listv = copy.copy(v)
        listv[i] = min(v) 
        listv[i] = max(listv)
        if gcd_list(listv)> maxi:
            maxi = gcd_list(listv)
#最大公約数


print(maxi)

# 書き換え 2


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

print((t//a)*b)

Buggy python submission (verdict: Runtime Error):
import fractions
from functools import reduce

def gcd(*numbers):
    return reduce(fractions.gcd, numbers)

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

#in
n=int(input())
v=list(map(int, input().split()))

maxi = 0

# おなじか？
if len(list(set(v))) == 1:
    maxi = (v[0])
elif len(v) == 2:
    maxi = (max(v))
# 書き換え 1
else:
    for i in range(n):
        listv = v
        listv[i] = min(v) 
        listv[i] = max(listv)
        print(listv)
        print(v)
        listval = listv
        temp = gcd_list(listval)
        if temp> maxi:
            if temp != max(listv)
                maxi = temp
#最大公約数


print(maxi)

# 書き換え 2


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

print((t//a)*b)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
time= 0

first = n
second = 0
third = 0
forth = 0
fifth = 0
goal = 0

while goal != n:
    time += 1


    #6
    if fifth < e:
        e_moved = fifth
    else:
        e_moved = e
    fifth = fifth - e_moved
    goal = goal + e_moved

    #5
    if forth < d:
        d_moved = forth
    else:
        d_moved = d
    forth = forth - d_moved
    fifth = fifth + d_moved

    #4
    if third < c:
        c_moved = third
    else:
        c_moved = c
    third = third - c_moved
    forth = forth + c_moved

    #3
    if second < b:
        b_moved = second
    else:
        b_moved = b
    second = second - b_moved
    third = third + b_moved

    #2
    if first < a:
        a_moved = first
    else:
        a_moved = a
    first = first - a_moved
    second = second + a_moved


print(time)


Fixed submission:
n = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
time= 0

minroute = min([a,b,c,d,e])

time = (-(-n//minroute)) + 4

print(time)
Buggy python submission (verdict: Runtime Error):
D = int().input()
if D==22:
  print("Christmas Eve Eve Eve")
else if D == 23:
  print("Christmas Eve Eve")
else if D == 24:
  print("Christmas Eve")
else:
  print("Cristmas")

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: Runtime Error):
n = int(input())
 
if n == 1:
  print("Hello World")
else:
  a,b = map(int, input().split())
  print(a+b)

Fixed submission:
n = int(input())
 
if n == 1:
  print("Hello World")
else:
  a = int(input())
  b = int(input())
  print(a+b)

Buggy python submission (verdict: Runtime Error):
n = int(input())

if n == 1:
  print("Hello World")
  
else:
  a,b = map(int, input().split())
  print(a+b)

Fixed submission:
n = int(input())
 
if n == 1:
  print("Hello World")
else:
  a = int(input())
  b = int(input())
  print(a+b)
Buggy python submission (verdict: Runtime Error):
n = int(input())

used = [empty]
ans = "Yes"

for i in range(n):
    if i == 0:
        t = str(input())
        
        past = t
    else:
        t = str(input())
        for j in used:
            if j == t:
                ans = "No"
    
    if past[-1] != t[1]:
        ans = "No"
    used.append(t)
    past = t

print(ans)

    
    


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

for i in range(1,3):
    if ((a*b*i)%2) == 1:
        c = 1

if c == 1:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
n = int(input())

used = []
ans = "Yes"

for i in range(n):
    if i == 0:
        t = str(input())
    else:
        t = str(input())
        print(t + "!")
        for j in used:
            if t == j:
                ans = "No"

        if len(t) == 1:
            if past[]
            
        else:
            if past[-1] != t[0]:
               ans == "No"
    used.append(t)
    past = t

print(ans)

Fixed submission:

s = int(input())
last = str(input())
wordlist = [last]
ans = "Yes"

for i in range(s-1):
    word = str(input())

    if last[-1] != word[0]:
        ans = "No"
        break
    
    elif word in wordlist:
        ans = "No"
        break

    last = word
    wordlist.append(word)

print(ans)

Buggy python submission (verdict: Runtime Error):
n = int(input())

used = []
ans = "Yes"

for i in range(n):
    if i == 0:
        t = str(input())
    else:
        t = str(input())
        for j in used:
            if t == j:
                ans = "No"
        if past[-1] != t[1]:
            ans == "No"
    used.append(t)
    past = t

print(ans)

Fixed submission:

s = int(input())
last = str(input())
wordlist = [last]
ans = "Yes"

for i in range(s-1):
    word = str(input())

    if last[-1] != word[0]:
        ans = "No"
        break
    
    elif word in wordlist:
        ans = "No"
        break

    last = word
    wordlist.append(word)

print(ans)

Buggy python submission (verdict: Runtime Error):
n = int(input())

used = ["empty"]
ans = "Yes"

for i in range(n):
    if i == 0:
        t = str(input())
        
        past = t
    else:
        t = str(input())
        for j in used:
            if j == t:
                ans = "No"
    
    if past[-1] != t[1]:
        ans = "No"
    used.append(t)
    past = t

print(ans)

    
    


Fixed submission:

s = int(input())
last = str(input())
wordlist = [last]
ans = "Yes"

for i in range(s-1):
    word = str(input())

    if last[-1] != word[0]:
        ans = "No"
        break
    
    elif word in wordlist:
        ans = "No"
        break

    last = word
    wordlist.append(word)

print(ans)

Buggy python submission (verdict: Runtime Error):
n = int(input())

used = []
ans = "Yes"

for i in range(n):
    if i == 0:
        t = str(input())
        
        past = t
    else:
        t = str(input())
        for j in used:
            if j == t:
                ans = "No"
    
    if past[-1] != t[1]:
        ans = "No"
    used.append(t)
    past = t

print(ans)

    
    


Fixed submission:

s = int(input())
last = str(input())
wordlist = [last]
ans = "Yes"

for i in range(s-1):
    word = str(input())

    if last[-1] != word[0]:
        ans = "No"
        break
    
    elif word in wordlist:
        ans = "No"
        break

    last = word
    wordlist.append(word)

print(ans)
Buggy python submission (verdict: Runtime Error):
x1, y1, x2, y2 = map(int, input().split())
 
x3 = x2 + (y1 - y2)
y3 = y2 - (x1 - x2)
x4 = x3 + (x1 - x2)
y4 = y3 + (y1 - y2)
 
print(x3, y3, x4, y4)

Fixed submission:
a = int(input())

oddl = []
evenl = []

for i in range(a):
    if i%2 == 1:
        oddl.append(i)
    else:
        evenl.append(i)

odd = len(oddl)
even = len(evenl)

print(odd*even)
Buggy python submission (verdict: Runtime Error):
a = int(input())

if a == 105:
    print(1)
elif a <= 104:
    print(0)
else:
    cnt = 0
    divs = 0
    for i in range(1,a+1, 2):
        divs = 0
        for j in range(1,i+1):
            if i%j == 0:
                divs += 1
        if divs == 8:
            cnt += 1

print(cnt)


Fixed submission:
a = int(input())

if a == 105:
    cnt = 1
elif a <= 104:
    cnt = 0
else:
    cnt = 0
    divs = 0
    for i in range(1,a+1, 2):
        divs = 0
        for j in range(1,i+1):
            if i%j == 0:
                divs += 1
        if divs == 8:
            cnt += 1

print(cnt)