Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
def possibleCombos(num):
    num2 = num - 1
    return (num2*num2 + num2)//2
N = int(input())
A = [int(i) for i in input().split()]
data = [0] * N
total = 0
for i in A:
    data[i] +=1
for i in data:
    total += possibleCombos(i)
for i in A:
    result = total - possibleCombos(data[i]) + possibleCombos(data[i]-1)
    print(result)

Fixed submission:
def possibleCombos(num):
    num2 = num - 1
    return (num2*num2 + num2)//2
N = int(input())
A = [int(i) for i in input().split()]
data = [0] * (N+1)
total = 0
for i in A:

    data[i] +=1

for i in data:
    total += possibleCombos(i)
for i in A:
    result = total - possibleCombos(data[i]) + possibleCombos(data[i]-1)
    print(result)

Buggy python submission (verdict: Time Limit Exceeded):
def possibleCombos(num):
    num2 = num - 1
    return (num2*num2 + num2)//2
N = int(input())
A = [i for i in input().split()]
keys = {i:A.count(i) for i in sorted(set(A)) }
for i in A:
    result = 0
    for k in keys.keys():
        count = keys[k] - 1 if k == i else keys[k]
        result += possibleCombos(count)
    print(result)

Fixed submission:
def possibleCombos(num):
    num2 = num - 1
    return (num2*num2 + num2)//2
N = int(input())
A = [int(i) for i in input().split()]
data = [0] * (N+1)
total = 0
for i in A:

    data[i] +=1

for i in data:
    total += possibleCombos(i)
for i in A:
    result = total - possibleCombos(data[i]) + possibleCombos(data[i]-1)
    print(result)

Buggy python submission (verdict: Time Limit Exceeded):
def possibleCombos(num):
    return sum([i-1 for i in range(1,num+1)])


N = int(input())
A = [i for i in input().split()]
keys = {}
for i in A:
    if  i not in keys.keys():
        keys[i] = 1
        continue 
    keys[i] += 1
for i in A:
    combos = 0
    for k in keys.keys():
        num = keys[k]-1 if k == i else keys[k]
        combos += possibleCombos(num)
    print(combos)


Fixed submission:
def possibleCombos(num):
    num2 = num - 1
    return (num2*num2 + num2)//2
N = int(input())
A = [int(i) for i in input().split()]
data = [0] * (N+1)
total = 0
for i in A:

    data[i] +=1

for i in data:
    total += possibleCombos(i)
for i in A:
    result = total - possibleCombos(data[i]) + possibleCombos(data[i]-1)
    print(result)
Buggy python submission (verdict: Runtime Error):
N, K = list(map(int, input().split()))
h_l = [0]*100000
i = 0
for i in range(N):
    x = int(input())
    h_l[i] = x
    x = 0
j = 0
min = 1000000000
h_list = [j for j in h_l if h_l[j] == 0]
h_list.sort()
y = 0
q = 0
while q < N-K+1:
    y = h_list[q + K - 1] - h_list[q]
    if y < min:
        min = y
        y = 0
    else:
        y = 0
    q += 1
print(min)


Fixed submission:
N, K = list(map(int, input().split()))
# print(N)
# print(K)
h_list = [0]*100000
i = 0
for i in range(N):
    x = int(input())
    h_list[i] = x
    x = 0
j = 0
min = 1000000000
for i in range(100000 - N):
    h_list.remove(0)
# print(h_list)
h_list.sort()
# print(h_list)
y = 0
q = 0
while q < N-K+1:
    y = h_list[q + K-1] - h_list[q]
#    print(q)
#    print(h_list[q+K-1], h_list[q])
    if y < min:
        min = y
        y = 0
    else:
        y = 0
    q += 1
print(min)

Buggy python submission (verdict: Runtime Error):
N, K = list(map(int, input().split()))
# print(N)
# print(K)
h_l = [0]*100000
i = 0
for i in range(N):
    x = int(input())
    h_l[i] = x
    x = 0
j = 0
min = 1000000000
h_list = [j for j in h_l if h_l[j] == 0]
h_list.sort()
# print(h_list)
y = 0
q = 0
while q < N-K+1:
    y = h_list[q + K - 1] - h_list[q]
#    print(q)
#    print(h_list[q+K-1], h_list[q])
    if y < min:
        min = y
        y = 0
    else:
        y = 0
    q += 1
print(min)


Fixed submission:
N, K = list(map(int, input().split()))
# print(N)
# print(K)
h_list = [0]*100000
i = 0
for i in range(N):
    x = int(input())
    h_list[i] = x
    x = 0
j = 0
min = 1000000000
for i in range(100000 - N):
    h_list.remove(0)
# print(h_list)
h_list.sort()
# print(h_list)
y = 0
q = 0
while q < N-K+1:
    y = h_list[q + K-1] - h_list[q]
#    print(q)
#    print(h_list[q+K-1], h_list[q])
    if y < min:
        min = y
        y = 0
    else:
        y = 0
    q += 1
print(min)
Buggy python submission (verdict: Runtime Error):
S = list(input())

if S[2]==S[3]:
	if S[4] == S[5]:
    	print('Yes')
	else:
      print('No')
else:
  print('No')
  




Fixed submission:
S= list(input())
 
if S[2]==S[3]:
    if S[4] == S[5]:
        print('Yes')
    else:
        print('No')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
K,N = map(int,input().split())
A = list(map(int,input()))
L = []
T = K+A[0]-A[-1]
for i in range(N-1):
  L.append(A[i+1]-A[i])
print(K-max(L))

Fixed submission:
K,N = map(int,input().split())
A = list(map(int,input().split()))
L = []
T = K+A[0]-A[-1]
for i in range(N-1):
  L.append(A[i+1]-A[i])
L.append(T)
print(K-max(L))

Buggy python submission (verdict: Runtime Error):
K,N = map(int,input().split())
A = list(map(int,input()))
L = 0
for i in range(0,N-1):
    if A[i+1]-A[i] >L:
        L = A[i+1]-A[i]
print(K-L)

Fixed submission:
K,N = map(int,input().split())
A = list(map(int,input().split()))
L = []
T = K+A[0]-A[-1]
for i in range(N-1):
  L.append(A[i+1]-A[i])
L.append(T)
print(K-max(L))
Buggy python submission (verdict: Runtime Error):
a, b = input(), input()
if (int(a) * int(b)) % 2 == 0:
  print("Even")
else:
  print("Odd")

Fixed submission:
a, b = input().split()
if (int(a) * int(b)) % 2 == 0:
  print("Even")
else:
  print("Odd")
Buggy python submission (verdict: Runtime Error):
s = input()
c = s.count(1)
print(c)

Fixed submission:
s = input()
c = s.count("1")
print(c)
Buggy python submission (verdict: Runtime Error):
str = input()

str[2] == str[3] and str[4] == str[5] ? 'Yes' : 'No'


Fixed submission:
str = input()

if str[2] == str[3] and str[4] == str[5]:
  print('Yes')
else :
  print('No')

Buggy python submission (verdict: Runtime Error):
str = input()

str[2] == str[3] and str[4] == str[5] ? 'Yes' : 'No';


Fixed submission:
str = input()

if str[2] == str[3] and str[4] == str[5]:
  print('Yes')
else :
  print('No')

Buggy python submission (verdict: Runtime Error):
str = input()

str[2] == str[3] && str[4] == str[5] ? 'Yes' : 'No';


Fixed submission:
str = input()

if str[2] == str[3] and str[4] == str[5]:
  print('Yes')
else :
  print('No')
Buggy python submission (verdict: Runtime Error):
s = input()
a = s.split()
count = 0
j = len(s)
for i in range(j):
  if i<=j:
  	if a[i] != a[j-i-1]:
    	count += 1 
print(count)

Fixed submission:
s = input()
n = len(s)
count = 0
for i in range(n//2):
  if s[i] != s[n - 1 - i]:
    count += 1 
print(count)

Buggy python submission (verdict: Runtime Error):
s = input()
a = s.split()
count = 0
j = len(s)
for i in range(j):
  if i<j:
  	if a[i] != a[j-i-1]:
    	count += 1 
print(count)

Fixed submission:
s = input()
n = len(s)
count = 0
for i in range(n//2):
  if s[i] != s[n - 1 - i]:
    count += 1 
print(count)

Buggy python submission (verdict: Runtime Error):
s = input()
a = s.split()
count = 0
j = len(s)
for i in range(j):
  if a[i] != a[j-i-1]:
    count += 1 
print(count)

Fixed submission:
s = input()
n = len(s)
count = 0
for i in range(n//2):
  if s[i] != s[n - 1 - i]:
    count += 1 
print(count)
Buggy python submission (verdict: Runtime Error):
N,M=map(int(input().split())
total=0
if N>=2
	total+=N*(N-1)/2
if M>=2
    total+=M*(M-1)/2
print(total)

Fixed submission:
N,M=map(int,input().split())
t =0
if N>=2:
	t+=N*(N-1)//2
if M>=2:
    t+=M*(M-1)//2
print(t)
Buggy python submission (verdict: Runtime Error):
n,l=map(int,input().split())
s=[]
for i in range(n):
  s.append(input())
s.sort()
ans=""
for i in s:
  ans+=i
print(ans)

Fixed submission:
abc=list(map(int,input().split()))
if abc.count(5)==2 and abc.count(7)==1:
  print ("YES")
else:
  print ("NO")
Buggy python submission (verdict: Runtime Error):
s=input()
if s[2]==s[3] and s[4]==s[5]:
  print("Yes")
else:
  print("No')

Fixed submission:
s=input()
if s[2]==s[3] and s[4]==s[5]:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
f=list(map(int,input().split()))
k=f[0];n=f[1]
dists=list(map(int,input().split()))
prev=0
maxdist=0
for d in range(1,len(dists)):
  maxdist=max(maxdist,abs(prev-dists[d]))
  prev=dists[d]
a=max(maxdist,maxdist-dists[len(dists)]+dists[0])  
ans=k-a
print(ans)

Fixed submission:
k,n = map(int, input().split())
a = list(map(int, input().split()))
max_dis = 0
for i in range(n):
    if i == n-1:
        max_dis = max(max_dis,a[0]+k-a[i])
    else:
        max_dis = max(max_dis,a[i+1]-a[i])
print(k-max_dis)
Buggy python submission (verdict: Runtime Error):
W= [int(x) for x in input().split()]
print("Yes" if len(set(W) ==2 else "No") 

Fixed submission:
W= [int(x) for x in input().split()]
print("Yes" if len(set(W)) ==2 else "No")
Buggy python submission (verdict: Runtime Error):
import numpy as np

N,K = [int(i) for i in input().split()]
n = np.array([int(i) for i in input().split()])
n=np.sort(n)

mn = n[np.where(n<0)]
mz = n[np.where(n==0)]
mp = n[np.where(n>0)]

M = 10**18
m = -1*M-1
pos = 0

while M-m > 1:
    a = 0
    pos=(M+m)//2
    a+=np.searchsorted(n,pos//mp,side="right").sum()
    a+=cz*N
    a+=N*len(mn) - np.searchsorted(n,-(-pos//mn),side="left").sum()
    a-=np.count_nonzero(n*n <= pos)
    a=a//2
    if a >= K:
        M=pos
    else:
        m=pos
#print(M,m)
print(M)


Fixed submission:
import numpy as np

N,K = [int(i) for i in input().split()]
n = np.array([int(i) for i in input().split()])
n=np.sort(n)

mn = n[np.where(n<0)]
mz = n[np.where(n==0)]
mp = n[np.where(n>0)]

#cn = len(mn)
##cp = len(mp)
#cz = len(mz)
#tcn = cn*cp

#if cn*cp < K <= cn*cp + (N-cz)*cz + cz*(cz-1)//2:
#    print(0)
#    exit(0)

M = 10**18
m = -1*M-1
pos = 0

while M-m > 1:
    a = 0
    pos=(M+m)//2
    a+=np.searchsorted(n,pos//mp,side="right").sum()
    if pos >= 0: a+=len(mz)*N
    a+=N*len(mn) - np.searchsorted(n,-(-pos//mn),side="left").sum()
    a-=np.count_nonzero(n*n <= pos)
    a=a//2
    if a >= K:
        M=pos
    else:
        m=pos
#print(M,m)
print(M)

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

N,K = [int(i) for i in input().split()]
n = np.array([int(i) for i in input().split()])
n=np.sort(n)

mn = n[np.where(n<0)]
mz = n[np.where(n==0)]
mp = n[np.where(n>0)]

#cn = len(mn)
#cp = len(mp)
#cz = len(mz)
#tcn = cn*cp

#if cn*cp < K <= cn*cp + (N-cz)*cz + cz*(cz-1)//2:
#    print(0)
#    exit(0)

M = 10**18
m = -1*M-1
pos = 0

while M-m > 1:
    a = 0
    pos=(M+m)//2
    a+=np.searchsorted(n,pos//mp,side="right").sum()
    a+=cz*N
    a+=N*len(mn) - np.searchsorted(n,-(-pos//mn),side="left").sum()
    a-=np.count_nonzero(n*n <= pos)
    a=a//2
    if a >= K:
        M=pos
    else:
        m=pos
#print(M,m)
print(M)


Fixed submission:
import numpy as np

N,K = [int(i) for i in input().split()]
n = np.array([int(i) for i in input().split()])
n=np.sort(n)

mn = n[np.where(n<0)]
mz = n[np.where(n==0)]
mp = n[np.where(n>0)]

#cn = len(mn)
##cp = len(mp)
#cz = len(mz)
#tcn = cn*cp

#if cn*cp < K <= cn*cp + (N-cz)*cz + cz*(cz-1)//2:
#    print(0)
#    exit(0)

M = 10**18
m = -1*M-1
pos = 0

while M-m > 1:
    a = 0
    pos=(M+m)//2
    a+=np.searchsorted(n,pos//mp,side="right").sum()
    if pos >= 0: a+=len(mz)*N
    a+=N*len(mn) - np.searchsorted(n,-(-pos//mn),side="left").sum()
    a-=np.count_nonzero(n*n <= pos)
    a=a//2
    if a >= K:
        M=pos
    else:
        m=pos
#print(M,m)
print(M)
Buggy python submission (verdict: Runtime Error):
N,K = [int(x) for x in input().split()]
n=[int(x) for x in input().split()]
print("Yes" if sum(n)=>N else "No")


Fixed submission:
N,K = [int(x) for x in input().split()]
n=[int(x) for x in input().split()]
print("Yes" if sum(n)>=N else "No")
Buggy python submission (verdict: Runtime Error):
N,S = [int(x) for x in input().split()]
a=max(N,S)
b=min(N,S)
c=0
for i in range(min): c+=a*10**i
print(c)

Fixed submission:
N,S = [int(x) for x in input().split()]
a=max(N,S)
b=min(N,S)
c=0
for i in range(a): c+=b*10**i
print(c)
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np

N = int(input())
n = [int(x) for x in input().split()]
n=np.array(n)

a=1
for i in range(1,N):
    if np.min(n[:i]) > n[i] : a+=1   
print(a)

Fixed submission:
import numpy as np

N = int(input())
n = [int(x) for x in input().split()]
n=np.array(n)

a=1
pos=0
for i in range(1,N):
    if n[pos] > n[i] :
        a+=1
        pos=i
print(a)

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

N = int(input())
n = [int(x) for x in input().split()]
n=np.array(n)

a=1
for i in range(1,N):
    if np.min(n[:i]) < n[i] : continue
    else: a+=1   
print(a)

Fixed submission:
import numpy as np

N = int(input())
n = [int(x) for x in input().split()]
n=np.array(n)

a=1
pos=0
for i in range(1,N):
    if n[pos] > n[i] :
        a+=1
        pos=i
print(a)

Buggy python submission (verdict: Runtime Error):
N = int(input())
n = [int(x) for x in input().split()]
n=np.array(n)

a=1
for i in range(1,N):
    if np.min(n[:i]) < n[i] : continue
    else: a+=1   
print(a)

Fixed submission:
import numpy as np

N = int(input())
n = [int(x) for x in input().split()]
n=np.array(n)

a=1
pos=0
for i in range(1,N):
    if n[pos] > n[i] :
        a+=1
        pos=i
print(a)

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

N = int(input())
n = [int(x) for x in input().split()]
n=np.array(n)

a=1
for i in range(1,N):
    if np.count_nonzero(n[:i] < n[i]) : continue
    else: a+=1   
print(a)

Fixed submission:
import numpy as np

N = int(input())
n = [int(x) for x in input().split()]
n=np.array(n)

a=1
pos=0
for i in range(1,N):
    if n[pos] > n[i] :
        a+=1
        pos=i
print(a)
Buggy python submission (verdict: Runtime Error):
import fractions
from functools import reduce
N,M= [int(i) for i in input().split()]
n = [int(i) for i in input().split()]
#print(n)
n=sorted(set(n),reverse = True)
bs = n[0]
#print(n)
#c=len(n)


def lcm_b(a, b):
        #print("base",a,b)
        return (a * b) // fractions.gcd(a, b)

def lcm_o():
        global n
        return reduce(lcm_b, n)

def chk(v):
        global n
        for i in range(1,30):
                if v%2 == 1:break
                v = v//2
        t=2**(i-1)
        for j in range(len(n)):
                if n[j] % t == 0 and (n[j] / t) % 2 == 1:
                        n[j] = int(n[j]/t)
                else: return 0
        return i-1

if len(n) > 0:
        
        c = chk(n[-1])
        
        if  c != 0:
                v = lcm_o()*(2**(c-1))
                
                if v > M:
                        print(0) 
                else:
                        v = M//v
                        if v%2==1: v+=1
                        print(int(v//2))
        
        else: print(0)
elif N==1:
        v = int(bs*0.5)
        v = M//v
        if v%2==1: v+=1
        print(int(v//2))

Fixed submission:
N,M= [int(i) for i in input().split()]
print("Yes" if N*500 >= M else "No")
Buggy python submission (verdict: Runtime Error):
N= int(input())
M= input()
print(M.find("ABC")

Fixed submission:
N= int(input())
M= input()
print(M.count("ABC"))
Buggy python submission (verdict: Runtime Error):
import math
K = int(input())
if K==2: print(K)
else:
        if K%2 ==0:K+=1
                while True:
                        flg =0
                        N = int(math.sqrt(K))
        
                        for i in range(2,N):
                                if K%i == 0:
                        
                                        flg = 1
                                        break
                        if flg == 0:
                                print(K)
                                break
                        K+=2

Fixed submission:
import math
K = int(input())
if K==2: print(K)
else:
        if K%2 ==0:
                K+=1
        while True:
                flg =0
                N = int(math.sqrt(K))
        
                for i in range(2,N):
                        if K%i == 0:
                        
                                flg = 1
                                break
                if flg == 0:
                        print(K)
                        break
                K+=2

Buggy python submission (verdict: Runtime Error):
import math
K = int(input())
if K==2: print(K)
else:
if K%2 ==0:K+=1
        while True:
                flg =0
                N = int(math.sqrt(K))
        
                for i in range(2,N):
                        if K%i == 0:
                        
                                flg = 1
                                break
                if flg == 0:
                        print(K)
                        break
                K+=2

Fixed submission:
import math
K = int(input())
if K==2: print(K)
else:
        if K%2 ==0:
                K+=1
        while True:
                flg =0
                N = int(math.sqrt(K))
        
                for i in range(2,N):
                        if K%i == 0:
                        
                                flg = 1
                                break
                if flg == 0:
                        print(K)
                        break
                K+=2
Buggy python submission (verdict: Time Limit Exceeded):
N,M= [int(i) for i in input().split()]
n = sorted([int(x) for x in input().split()])

s =[0]*(N+1)
s[0]=n[0]
for i in range(1,N+1):
        s[i] = s[i-1]+n[i-1]
MM=n[-1]*2
mm=n[0]*2

while True:
        c=0        
        r=(mm+MM)//2
        for i in range(N):
                for j in range(N):
                   if n[i]+n[j] >= r:
                        c+=N-j
                        break
        if (MM-mm) < 2:
                break
        elif c>=M:
                mm=r
        elif c<M:
                MM=r

v=0
for i in range(N):
        for j in range(N):
                t=n[i]+n[j]
                if  t >= r:
                        v+= (s[N] - s[j]) + (N-j)*n[i]
                        break
v = v - (c-M)*(r)

print(v)                  


Fixed submission:
from bisect import bisect_left

N,M= [int(i) for i in input().split()]
n = sorted([int(x) for x in input().split()])

s =[0]*(N+1)
s[0]=n[0]
for i in range(1,N+1):
        s[i] = s[i-1]+n[i-1]
MM=n[-1]*2
mm=n[0]*2

while True:
        c=0        
        r=(mm+MM)//2
        for i in range(N):
                c += N-bisect_left(n,r-n[i])
        if (MM-mm) < 2:
                break
        elif c>=M:
                mm=r
        elif c<M:
                MM=r

v=0
for i in range(N):
        j=bisect_left(n,r-n[i])
        v+= (s[N] - s[j]) + (N-j)*n[i]

v = v - (c-M)*(r)

print(v)
Buggy python submission (verdict: Runtime Error):
for i in range(2):
	n.append([int(x) for x in input().split()])
print(1 if n[0][0]!=n[1][0] else 0)

Fixed submission:
n=[]
for i in range(2):
	n.append([int(x) for x in input().split()])
print(1 if n[0][0]!=n[1][0] else 0)
Buggy python submission (verdict: Runtime Error):
N=int(input())
a=math.ceil(N/1.08)
b=math.floor(a*1.08)
print(a if N==b else ":(")

Fixed submission:
import math
N=int(input())
a=math.ceil(N/1.08)
b=math.floor(a*1.08)
print(a if N==b else ":(")
Buggy python submission (verdict: Runtime Error):
N = int(input())
if N%2 == 1: print("No")
else:
    n=int(N/2)
    S = input()
    if S[:n]==s[n:] :print("Yes")
    else:print("No")

Fixed submission:
N = int(input())
S = input()
if N%2 == 1: print("No")
else:
    n=int(N/2)
    if S[:n]==S[n:] :print("Yes")
    else:print("No")

Buggy python submission (verdict: Runtime Error):
N = int(input())
if N%2 == 1: print("No")
else:
  	n=int(N/2)
    S = input()
    if S[:n]==s[n:] :print("Yes")
    else:print("No")


Fixed submission:
N = int(input())
S = input()
if N%2 == 1: print("No")
else:
    n=int(N/2)
    if S[:n]==S[n:] :print("Yes")
    else:print("No")

Buggy python submission (verdict: Runtime Error):
N = int(input())
if N%2 == 1: print("No")
else:
  	n=N//2
    S = input()
    if S[:n]==s[n:] :print("Yes")
    else:print("No")


Fixed submission:
N = int(input())
S = input()
if N%2 == 1: print("No")
else:
    n=int(N/2)
    if S[:n]==S[n:] :print("Yes")
    else:print("No")

Buggy python submission (verdict: Runtime Error):
N = int(input())
if N%2 == 1: print("No")
else:
    S = input()
    if S[:n]==S[n:] :print("Yes")
    else:print("No")

Fixed submission:
N = int(input())
S = input()
if N%2 == 1: print("No")
else:
    n=int(N/2)
    if S[:n]==S[n:] :print("Yes")
    else:print("No")

Buggy python submission (verdict: Runtime Error):
N = int(input())
if N%2 == 1: print("No")
else:
    S = input()
    if S[:n]==s[n:] :print("Yes")
    else:print("No")

Fixed submission:
N = int(input())
S = input()
if N%2 == 1: print("No")
else:
    n=int(N/2)
    if S[:n]==S[n:] :print("Yes")
    else:print("No")

Buggy python submission (verdict: Runtime Error):
N = int(input())
S = input()
if N%2 == 1: print("No")
elif S[:N/2] == S[N/2:]:print("Yes")
else: print("No")

Fixed submission:
N = int(input())
S = input()
if N%2 == 1: print("No")
else:
    n=int(N/2)
    if S[:n]==S[n:] :print("Yes")
    else:print("No")

Buggy python submission (verdict: Runtime Error):
N = int(input())
S = input()
if N%2 == 1: print("No")
elif S[:N/2] == S[N/2:] print("Yes")
else: print("No")

Fixed submission:
N = int(input())
S = input()
if N%2 == 1: print("No")
else:
    n=int(N/2)
    if S[:n]==S[n:] :print("Yes")
    else:print("No")
Buggy python submission (verdict: Runtime Error):
N = int(input())
n=[]
s=range(N)
for i in range(N):
    n.append([int(x) for x in input().split()])
Q = list(itertools.permutations(s))
L=0
for i in range(int(len(Q)/2)):
    for j in range(N-1):
        L+= np.sqrt((n[Q[i][j+1]][0] - n[Q[i][j]][0])**2 + (n[Q[i][j+1]][1] - n[Q[i][j]][1])**2)
print(L/(len(Q)/2))

Fixed submission:
import itertools
import numpy as np


N = int(input())
n=[]
s=range(N)
for i in range(N):
    n.append([int(x) for x in input().split()])
Q = list(itertools.permutations(s))
L=0
for i in range(int(len(Q))):
    for j in range(N-1):
        L+= np.sqrt((n[Q[i][j+1]][0] - n[Q[i][j]][0])**2 + (n[Q[i][j+1]][1] - n[Q[i][j]][1])**2)
print(L/(len(Q)))
Buggy python submission (verdict: Runtime Error):
L,R= [int(i) for i in input().split()]
n=[]
for i in range(R-L+1):	
	for j in range(i+1,R-L+1):
		a = (L+i)*(L+j)%2019
		if a == 0:
			print(0)
			exit()
		else 
			n.append((L+i)*(L+j)%2019)
print(min(n))


Fixed submission:
L,R= [int(i) for i in input().split()]
n=[]
for i in range(R-L+1):	
	for j in range(i+1,R-L+1):
		a = ((L+i)*(L+j))%2019
		if a == 0:
			print(0)
			exit()
		else: 
			n.append(((L+i)*(L+j))%2019)
print(min(n))

Buggy python submission (verdict: Time Limit Exceeded):
L,R= [int(i) for i in input().split()]
n=[]
for i in range(R-L+1):	
	for j in range(i+1,R-L+1):
		n.append((L+i)*(L+j)%2019)
print(min(n))


Fixed submission:
L,R= [int(i) for i in input().split()]
n=[]
for i in range(R-L+1):	
	for j in range(i+1,R-L+1):
		a = ((L+i)*(L+j))%2019
		if a == 0:
			print(0)
			exit()
		else: 
			n.append(((L+i)*(L+j))%2019)
print(min(n))
Buggy python submission (verdict: Runtime Error):
N,Y= [int(i) for i in input().split()]

if N < X:
	print(0)
else:
	print(10)


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

if N < Y:
	print(0)
else:
	print(10)

Buggy python submission (verdict: Runtime Error):
N,Y= [int(i) for i in input().split()]

if N < X:
	print(0)
else:
	print(10)


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

if N < Y:
	print(0)
else:
	print(10)
Buggy python submission (verdict: Runtime Error):
sm=sum(n)
av = sm/2
c =0

for i in range(len(n)):
	c += n[i]
	if c == av:
		print(0)
		exit()
	elif c > av:
		b1 = abs(c - (sm-c))
		b2 = abs((c-n[i]) - (sm-c+n[i]))
		print(b1 if b1<b2 else b2)
		exit()	


Fixed submission:
N = int(input())
n = list(map(int, input().split()))
sm=sum(n)
av = sm/2
c =0

for i in range(N):
	c += n[i]
	if c == av:
		print(0)
		exit()
	elif c > av:
		b1 = abs(c - (sm-c))
		b2 = abs((c-n[i]) - (sm-c+n[i]))
		print(b1 if b1<b2 else b2)
		exit()