Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
a, b, k = map(int, input().split())
l = []

for i in range(1,n+1):
    if a % i == 0 and b % i == 0:
        l.append(i)
        
print(l[k-1])
    

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

for i in range(1,min(a,b)+1):
    if a % i == 0 and b % i == 0:
        l.append(i)
        
print(list(reversed(l))[k-1])

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

for i in range(1,n+1):
    if a % i == 0 and b % i == 0:
        l.append(i)
print(l[k-1])

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

for i in range(1,min(a,b)+1):
    if a % i == 0 and b % i == 0:
        l.append(i)
        
print(list(reversed(l))[k-1])
Buggy python submission (verdict: Runtime Error):
H,N = map(int,input().split())
a = 0
for i in range(N):
        c = int(input())
        a+=c
if a>=H:
        print("Yes")
else:
        print("No")


Fixed submission:
H,N = map(int,input().split())
A = list(map(int,input().split()))
a = 0
for i in A:
        a+=i
if a>=H:
        print("Yes")
else:
        print("No")
Buggy python submission (verdict: Runtime Error):
i = ['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']
a = input()
b = i.index(a)
print(i[b+1])

Fixed submission:
i = ['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']
a = input()
b = i.index(a)
print(i[b+1])
Buggy python submission (verdict: Runtime Error):
K,X = map(int,input().split)())
if K*500>=X:
    print('Yes')
else:
    print('No')


Fixed submission:
K,X = map(int,input().split())
if K*500>=X:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
S,T = map(input().split())
print(T+S)

Fixed submission:
S,T = map(str,input().split())
print(T+S)
Buggy python submission (verdict: Runtime Error):
    N,A,B = map(int,input().split())
    if (B-A)%2==0:
        print(str(int(B-(B+A)/2)))
    else:
        if B-A==1:
            if N-A>B-1:
                print(B-1)
            else:
                print(N-A)
        else:
            if N-A>B-1:
                print(A+(A-B)/2)
            else:
                print(B+(B-A)/2)

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

Buggy python submission (verdict: Runtime Error):
N,A,B = map(int,input().split())
if (B-A)%2==0:
    print(str(int(B-(B+A)/2)))
else:
    if B-A==1:
        if N-A>B-1:
            print(B-1)
        else:
            rint(N-A)
    else:
        if N-A>B-1:
            print(A+(A-B)/2)
        else:
            print(B+(B-A)/2)


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

Buggy python submission (verdict: Runtime Error):
N,A,B = map(int,input().split())
if (B-A)%2==0:
    print(str(int(B-(B+A)/2)))
else:
    if B-A==1:
        if N-A>B-1:
            print(B-1)
        else:
            rint(N-A)
    else:
        if N-A>B-1:
            print(A+(A-B)/2)
        else:
            print(B+(B-A)/2)


Fixed submission:
N,A,B = map(int,input().split())
if (B-A)%2==0:
    print(str(int(B-(B+A)//2)))
else:
    if N-B>A-1:
        print(str(int(A+(B-A-1)//2)))
    else:
        print(str(int(N-B+1+(B-A-1)//2)))
Buggy python submission (verdict: Runtime Error):
N = int(input())
S,T = map(str,input().split())
A = ""
for i in S:
  A+=i
  for j in T:
    A+=j
print(A)


Fixed submission:
A = int(input())
B = int(input())
x=1
for i in range(3):
  if x!=A and x!=B:
    print(str(x))
  x+=1

Buggy python submission (verdict: Runtime Error):
A = int(input())
B = int(input())
x=1
for i range(3):
  if x!=A and x!=B:
    print(str(x))
  x+=1

Fixed submission:
A = int(input())
B = int(input())
x=1
for i in range(3):
  if x!=A and x!=B:
    print(str(x))
  x+=1
Buggy python submission (verdict: Runtime Error):
import math
A,B=map(int,input().split())
x=A*B//(math.gcd(A,B))

print(x)


Fixed submission:
N = int(input())
S,T = map(str,input().split())
A = ""
for (i,j) in zip(S,T):
  A+=i
  A+=j
print(A)

Buggy python submission (verdict: Runtime Error):
N = int(input())
S,T = map(input().split())
A = ""
for i in S:
  A+=i
  for j in T:
    A+=j
print(A)


Fixed submission:
N = int(input())
S,T = map(str,input().split())
A = ""
for (i,j) in zip(S,T):
  A+=i
  A+=j
print(A)

Buggy python submission (verdict: Runtime Error):
N = int(input())
S,T = map(input().split())
A = ""
for i in S:
  A+=i
  for j in T:
    A+=j
print(A)


Fixed submission:
N = int(input())
S,T = map(str,input().split())
A = ""
for (i,j) in zip(S,T):
  A+=i
  A+=j
print(A)

Buggy python submission (verdict: Runtime Error):
N = int(input())
S = input()
T = input()
A = ''
for i in S:
  A+=i
  for j in T:
    A+=j
print(A)

Fixed submission:
N = int(input())
S,T = map(str,input().split())
A = ""
for (i,j) in zip(S,T):
  A+=i
  A+=j
print(A)

Buggy python submission (verdict: Runtime Error):
N = int(input())
S = input()
T = input()
A = ''
for i in S:
  for j in T:
    A+=(i+j)
print(A)

    

Fixed submission:
N = int(input())
S,T = map(str,input().split())
A = ""
for (i,j) in zip(S,T):
  A+=i
  A+=j
print(A)
Buggy python submission (verdict: Runtime Error):
import math
A,B=map(int,input().split())
x=(A*B)/(math.gcd(A,B))

print(str(x))


Fixed submission:
from fractions import gcd
A,B=map(int,input().split())
x=(A*B)//(gcd(A,B))

print(x)

Buggy python submission (verdict: Runtime Error):
import math
A,B=map(int,input().split())
x=(A*B)//(math.gcd(A,B))

print(str(x))


Fixed submission:
from fractions import gcd
A,B=map(int,input().split())
x=(A*B)//(gcd(A,B))

print(x)

Buggy python submission (verdict: Runtime Error):
import math
A,B=map(int,input().split())
x=A*B//math.gcd(A,B)

print(x)


Fixed submission:
from fractions import gcd
A,B=map(int,input().split())
x=(A*B)//(gcd(A,B))

print(x)

Buggy python submission (verdict: Runtime Error):
import math
A,B=map(int,input().split())
x=A*B//gcd(A,B)

print(x)


Fixed submission:
from fractions import gcd
A,B=map(int,input().split())
x=(A*B)//(gcd(A,B))

print(x)

Buggy python submission (verdict: Runtime Error):
import math
A,B=map(int,input().split())
print(str(math.gcd(A,B)))


Fixed submission:
from fractions import gcd
A,B=map(int,input().split())
x=(A*B)//(gcd(A,B))

print(x)

Buggy python submission (verdict: Runtime Error):
import math
A,B=map(int,input().split())
print(str(gcd(A,B)))

Fixed submission:
from fractions import gcd
A,B=map(int,input().split())
x=(A*B)//(gcd(A,B))

print(x)
Buggy python submission (verdict: Runtime Error):
round = 3.1415
 
r = input()
print(r*2*round)

Fixed submission:
round = 6.28318530717958623200

 
r = int(input())
print(r*round)

Buggy python submission (verdict: Runtime Error):
round = 3.1415

r = input()
print(r*2*rount)

Fixed submission:
round = 6.28318530717958623200

 
r = int(input())
print(r*round)

Buggy python submission (verdict: Runtime Error):
num = input()
round = 3.141592653589793

print(num*2*rount)


Fixed submission:
round = 6.28318530717958623200

 
r = int(input())
print(r*round)
Buggy python submission (verdict: Runtime Error):
import numpy as np

n = int(input())
A = np.array([int(i) for i in input().split()])

A=np.sort(A)
s=A[0]
for i in range(max([n, s])):
    c = A[0]
    A = A % c
    A[0] = c
    z=A.count(0)
    A=np.sort(A)[z:]
    for j in range(len(A)):
        if A[0] != 0:
            break
        A = np.delete(A, 0)
    if len(A) == 1:
        break
print (A[0])

Fixed submission:
import numpy as np

n = int(input())
A = np.array([int(i) for i in input().split()])

A=np.sort(A)
s=A[0]
for i in range(max([n, s])):
    c = A[0]
    A = A % c
    A[0] = c
    z=len(A) - np.count_nonzero(A)
    A=np.sort(A)[z:]
    if len(A) == 1:
        break
print (A[0])

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np

n = int(input())
A = np.array([int(i) for i in input().split()])

A=np.sort(A)
s=A[0]
for i in range(max([n, s])):
    c = A[0]
    A = A % c
    A[0] = c
    A=np.sort(A)
    for j in range(len(A)):
        if A[0] != 0:
            break
        A = np.delete(A, 0)
    if len(A) == 1:
        break
print (A[0])

Fixed submission:
import numpy as np

n = int(input())
A = np.array([int(i) for i in input().split()])

A=np.sort(A)
s=A[0]
for i in range(max([n, s])):
    c = A[0]
    A = A % c
    A[0] = c
    z=len(A) - np.count_nonzero(A)
    A=np.sort(A)[z:]
    if len(A) == 1:
        break
print (A[0])
Buggy python submission (verdict: Runtime Error):
s=input()
S=[]
for i in range(s):
    S.append(s[i])
d=[]
for i in range(len(S)-2):
    N=int(S[i:i+3])
    d.append(abs(N-753))
print(min(d))

Fixed submission:
S=input()
d=[]
for i in range(len(S)-2):
    N=int(S[i:i+3])
    d.append(abs(N-753))
print(min(d))

Buggy python submission (verdict: Runtime Error):
s=input()
S=[]
for i in range(s):
    S.append(s[i])
d=[]
for i in range(len(S)-2):
    N=100*int(S[i])+10*int(S[i+1])+int(s[i+2])
    d.append(abs(N-753))
print(min(d))

Fixed submission:
S=input()
d=[]
for i in range(len(S)-2):
    N=int(S[i:i+3])
    d.append(abs(N-753))
print(min(d))
Buggy python submission (verdict: Runtime Error):
n=int(input())

if n==0:
    print(0)
else:
    ans=""
    while n!=0:
        ans=str(n%2)+ans
        n=-1*(n//2)
ans=int(ans)
print(ans)

Fixed submission:
n=int(input())

if n==0:
    ans="0"
else:
    ans=""
    while n!=0:
        ans=str(n%2)+ans
        n=-1*(n//2)
ans=int(ans)
print(ans)

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

if n==0:
    print(0)
else:
    ans=""
    while n!=0:
        ans=str(n%2)+ans
        n=n//(-2)
ans=int(ans)
print(ans)

Fixed submission:
n=int(input())

if n==0:
    ans="0"
else:
    ans=""
    while n!=0:
        ans=str(n%2)+ans
        n=-1*(n//2)
ans=int(ans)
print(ans)
Buggy python submission (verdict: Runtime Error):
#! /usr/bin/env python
# -*- coding: utf-8 -*-

def main():
	r = input()
	
	s = 2*r*3.1415926
	print (s)

if __name__ == '__main__':
	main()


Fixed submission:
#! /usr/bin/env python
# -*- coding: utf-8 -*-

def main():
	r = int(input())
	
	s = 2*r*3.1415926
	print (s)

if __name__ == '__main__':
	main()
Buggy python submission (verdict: Time Limit Exceeded):
#! /usr/bin/env python
# -*- coding: utf-8 -*-
import math

    
def main():
	num = int(input())
	sum = 0
	for i in range(num):
		a = i+1
		for j in range(num):
			b = j+1
			for k in range(num):
				c = k+1
				if a == b:
					sum += math.gcd(a,c)
				elif b == c or a == c:
					sum += math.gcd(a,b)
				else:
					sum += math.gcd(math.gcd(a,b),c)
	print (sum)

if __name__ == '__main__':
	main()


Fixed submission:
#! /usr/bin/env python
# -*- coding: utf-8 -*-
import math

    
def main():
	num = int(input())
	sum = 0
	for i in range(num):
		a = i+1
		for j in range(num):
			b = j+1
			for k in range(num):
				c = k+1
				sum += math.gcd(math.gcd(a,b),c)
	print (sum)

if __name__ == '__main__':
	main()

Buggy python submission (verdict: Time Limit Exceeded):
#! /usr/bin/env python
# -*- coding: utf-8 -*-
import math
from functools import reduce

def gcd(*numbers):
    return reduce(math.gcd, numbers)
    
def main():
	num = int(input())
	sum = 0
	for i in range(num):
		a = i+1
		for j in range(num):
			b = j+1
			for k in range(num):
				c = k+1
				if a == b:
					sum += math.gcd(a,c)
				elif b == c or a == c:
					sum += math.gcd(a,b)
				else:
					sum += gcd(a,b,c)
	print (sum)

if __name__ == '__main__':
	main()


Fixed submission:
#! /usr/bin/env python
# -*- coding: utf-8 -*-
import math

    
def main():
	num = int(input())
	sum = 0
	for i in range(num):
		a = i+1
		for j in range(num):
			b = j+1
			for k in range(num):
				c = k+1
				sum += math.gcd(math.gcd(a,b),c)
	print (sum)

if __name__ == '__main__':
	main()

Buggy python submission (verdict: Time Limit Exceeded):
#! /usr/bin/env python
# -*- coding: utf-8 -*-
import math
from functools import reduce

def gcd(*numbers):
    return reduce(math.gcd, numbers)
    
def main():
	num = int(input())
	sum = 0
	for i in range(num):
		a = i+1
		for j in range(num):
			b = j+1
			for k in range(num):
				c = k+1
				sum += gcd(a,b,c)
	print (sum)

if __name__ == '__main__':
	main()


Fixed submission:
#! /usr/bin/env python
# -*- coding: utf-8 -*-
import math

    
def main():
	num = int(input())
	sum = 0
	for i in range(num):
		a = i+1
		for j in range(num):
			b = j+1
			for k in range(num):
				c = k+1
				sum += math.gcd(math.gcd(a,b),c)
	print (sum)

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

N = int(input())
#s = [0,]*(N-1)
s = []
for i in range(N-1):
    #s[i] = int(input())
    s.append(int(input()))

ct = collections.Counter(s)

for i in range(N):
    print(ct[i+1])


Fixed submission:
import collections

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

ct = collections.Counter(s)

for i in range(N):
    print(ct[i+1])

Buggy python submission (verdict: Runtime Error):
from collections import Counter

N = int(input())
#s = [0,]*(N-1)
s = []
for i in range(N-1):
    #s[i] = int(input())
    s.append(int(input()))

ct = Counter(s)

for i in range(N):
    print(ct[i+1])


Fixed submission:
import collections

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

ct = collections.Counter(s)

for i in range(N):
    print(ct[i+1])

Buggy python submission (verdict: Runtime Error):
from collections import Counter

N = int(input())
s = [0]*(N-1)
for i in range(N-1):
    s[i] = int(input())

ct = Counter(s)

for i in range(N):
    print(ct[i+1])


Fixed submission:
import collections

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

ct = collections.Counter(s)

for i in range(N):
    print(ct[i+1])

Buggy python submission (verdict: Runtime Error):
from collections import Counter

N = int(input())
s = [0]*(N-1)
for i in range(N-1):
    #s[i] = ''.join(sorted(list(input())))
    s[i] = int(input())

ct = Counter(s)

for i in range(N):
    print(ct[i+1])


Fixed submission:
import collections

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

ct = collections.Counter(s)

for i in range(N):
    print(ct[i+1])

Buggy python submission (verdict: Runtime Error):
from collections import Counter

N = int(input())
s = [0]*(N-1)
for i in range(N-1):
    #s[i] = ''.join(sorted(list(input())))
    s[i] = int(input())

ct = Counter(s)

for i in range(1,N):
    if i in ct.keys():
        print(ct[i])
    else:
        print(0)
#print(0)


Fixed submission:
import collections

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

ct = collections.Counter(s)

for i in range(N):
    print(ct[i+1])

Buggy python submission (verdict: Runtime Error):
from collections import Counter

N = int(input())
s = [0]*(N-1)
for i in range(N-1):
    #s[i] = ''.join(sorted(list(input())))
    s[i] = int(input())

ct = Counter(s)

for i in range(1,N):
    if i in ct.keys():
        print(ct[i])
    else:
        print(0)
print(0)


Fixed submission:
import collections

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

ct = collections.Counter(s)

for i in range(N):
    print(ct[i+1])
Buggy python submission (verdict: Runtime Error):
import numpy as np

anum = {}
ans = 0

N = int(input())
strings = [''.join(sorted(input())) for i in range(N)]

for i in s:
    if i in anum:
        ans += anum[i]
    else:
        anum[i] = 1

print(ans)


Fixed submission:
N = int(input())
s = [''.join(sorted(input())) for i in range(N)]
dict = {}
ans = 0

for i in s:
    if i in dict:
        ans += dict[i]
        dict[i] += 1
    else:
        dict[i] = 1

print(ans)

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

anum = {}
ans = 0

N = int(input())
strings = [''.join(sorted(input())) for i in range(N)]

for i in range(N):
    if strings[i] in anum:
        ans += anum[i]
    else:
        anum[strings[i]] = 1

print(ans)


Fixed submission:
N = int(input())
s = [''.join(sorted(input())) for i in range(N)]
dict = {}
ans = 0

for i in s:
    if i in dict:
        ans += dict[i]
        dict[i] += 1
    else:
        dict[i] = 1

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np

anum = 0

N = int(input())
strings = []

for i in range(N):
    strings.append(input())

for i in range(N):
    temp = [s for s in strings[i]]
    temp.sort()
    strings[i] = ''.join(temp)

for i in range(N-1):
    for j in range(i+1,N):
        if strings[i] == strings[j]:
            anum += 1

print(anum)

Fixed submission:
N = int(input())
s = [''.join(sorted(input())) for i in range(N)]
dict = {}
ans = 0

for i in s:
    if i in dict:
        ans += dict[i]
        dict[i] += 1
    else:
        dict[i] = 1

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np

abcs = ["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"]
anum = 0

N = int(input())
strings = []
for i in range(N):
    strings.append(input())

for i in range(N-1):
    for j in range(i+1,N):
        c1 = np.zeros(26)
        c2 = np.zeros(26)
        for k in range(26):
            for l in range(10):
                if abcs[k] == strings[i][l]:
                    c1[k] += 1
                if abcs[k] == strings[j][l]:
                    c2[k] += 1
        if sum(c1 == c2) == 26:
            anum +=1

print(anum)


Fixed submission:
N = int(input())
s = [''.join(sorted(input())) for i in range(N)]
dict = {}
ans = 0

for i in s:
    if i in dict:
        ans += dict[i]
        dict[i] += 1
    else:
        dict[i] = 1

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = []
line = input()
for v in line.split():
    a.append(int(v))

for i in range(1, n +1):
    print(a.count(i))

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

result = [0 for _ in range(n)]
for i in range(n - 1):
    result[a[i]-1] += 1

for v in result:
    print(v)

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = []
for i in range(0, n - 1):
    a.append(int(input()))

for i in range(1, n +1):
    print(a.count(i))

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

result = [0 for _ in range(n)]
for i in range(n - 1):
    result[a[i]-1] += 1

for v in result:
    print(v)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))

for i in range(1, n +1):
    print(a.count(i))

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

result = [0 for _ in range(n)]
for i in range(n - 1):
    result[a[i]-1] += 1

for v in result:
    print(v)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
a.insert(0, 0)
a.insert(0, 0)

for i in range(1, n +1):
    print(a.count(i))

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

result = [0 for _ in range(n)]
for i in range(n - 1):
    result[a[i]-1] += 1

for v in result:
    print(v)
Buggy python submission (verdict: Runtime Error):
a, b, c = map(int, input().split())

a, b = b, a
a, c = c, a

print(a + " " + b + " " + c)

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

a, b = b, a
a, c = c, a

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

a.sort(reversed=True)
if a[m - 1] >= sum(a) / (4 * m):
    print("Yes")
else:
    print("No")

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

a.sort(reverse=True)
if a[m - 1] >= sum(a) / (4 * m):
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Time Limit Exceeded):
import math
from functools import reduce
K = int(input())
s = []
def gcd(*numbers):
    return reduce(math.gcd, numbers)
for i in range(K):
    for j in range(K):
        for k in range(K):
            s.append(gcd(i+1,j+1,k+1))
print(sum(s))

Fixed submission:
import math
from functools import reduce
K = int(input())
s = []
def gcd(*numbers):
    return reduce(math.gcd, numbers)
for i in range(K):
    for j in range(K):
        for k in range(K):
            s.append(gcd(i+1,j+1,k+1))
print(sum(s))

Buggy python submission (verdict: Time Limit Exceeded):
import math
from functools import reduce
K = int(input())
s = []
def gcd(*numbers):
    return reduce(math.gcd, numbers)
for i in range(K):
    for j in range(K):
        for k in range(K):
            s.append(gcd(i+1,j+1,k+1))
print(sum(s))


Fixed submission:
import math
from functools import reduce
K = int(input())
s = []
def gcd(*numbers):
    return reduce(math.gcd, numbers)
for i in range(K):
    for j in range(K):
        for k in range(K):
            s.append(gcd(i+1,j+1,k+1))
print(sum(s))
Buggy python submission (verdict: Runtime Error):
import itertools

n,m = map(int, input().split())

even = [i for i in range(2, 100, 2)]

odd = [i for i in range(1, 100, 2)]


seq = []


for i in range(n):
    seq.append(even[i])

for i in range(m):
    seq.append(odd[i])



cnt = 0

for v1, v2 in itertools.combinations(seq,2):
    tmp = int(v1) + int(v2)
    if tmp % 2 == 0:
        cnt += 1

print(cnt)


Fixed submission:
import itertools

n,m = map(int, input().split())

even = [i for i in range(2, 333, 2)]

odd = [i for i in range(1, 333, 2)]


seq = []


for i in range(n):
    seq.append(even[i])

for i in range(m):
    seq.append(odd[i])



cnt = 0

for v1, v2 in itertools.combinations(seq,2):
    tmp = int(v1) + int(v2)
    if tmp % 2 == 0:
        cnt += 1

print(cnt)
Buggy python submission (verdict: Time Limit Exceeded):
s = input()
q = int(input())

flg = True

def add(s , query , flg):
    if flg:
        if query[2] == '1':
            s = query[4] + s
        else:
            s = s + query[4]
    else:
        if query[2] == '1':
            s = s + query[4]
        else:
            s = query[4] + s
    return s

for i in range(q):
    query = input()
    if query[0] == '1':
        flg = not flg
    else:
        s = add(s ,query,flg)

if not flg:
    ans = s[::-1]
    print(ans)
else:
    print(s)

Fixed submission:
s = input()
q = int(input())

flg = True

mae = ''
ato = ''

for i in range(q):
    query = input()
    if query[0] == '1':
        flg = not flg
    else:
        if query[2] == '1':
            if flg:
                mae += query[4]
            else:
                ato += query[4]
        else:
            if flg:
                ato += query[4]
            else:
                mae += query[4]

mae = mae[::-1]
ans = mae + s + ato
if not flg:
    ans = ans[::-1]

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

a_min = min(a)
a_max = max(a)

x = a_max - a_min

for i in range(x):
    z = i + a_min
    hp = 0
    for x in a:
        hp += (x - z) ** 2
    if i == 0:
        ans = hp
    if ans > hp:
        ans = hp

print(ans)

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

a_min = min(a)


for i in range(100):
    z = i + a_min
    hp = 0
    for x in a:
        hp += (x - z) ** 2
    if i == 0:
        ans = hp
    if ans > hp:
        ans = hp

print(ans)

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

a_min = min(a)
a_max = max(a)

n = a_max - a_min

for i in range(n):
    z = i + a_min
    hp = 0
    for x in a:
        hp += (x - z) ** 2
    if i == 0:
        ans = hp
    if ans > hp:
        ans = hp

print(ans)

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

a_min = min(a)


for i in range(100):
    z = i + a_min
    hp = 0
    for x in a:
        hp += (x - z) ** 2
    if i == 0:
        ans = hp
    if ans > hp:
        ans = hp

print(ans)