Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
mod=10**9+7
ans=1
for i in range(1,n+1):
    ans*=i
print(ans%mod)

Fixed submission:
import math
n=int(input())
mod=10**9+7
print(math.factorial(n)%mod)
Buggy python submission (verdict: Runtime Error):
A,B,C,K=map(int,input().split())
m=0
if A-K>=0:
  print(A):
else:
  K=K-A
  if B>=K:
    print(A)
  else:
    K=K-B
    print(A-K)
  


Fixed submission:
A,B,C,K=map(int,input().split())
m=0
if A-K>=0:
  print(K)
else:
  K=K-A
  if B>=K:
    print(A)
  else:
    K=K-B
    print(A-K)
Buggy python submission (verdict: Runtime Error):
N=int(input())
for A in range(-118,120):
  for B in range(-119,119):
    if A**5-B**5==N:
      print(A,B)
      exit()

Fixed submission:
S=str(input())
if S=="ABC":
  print("ARC")
else:
  print("ABC")
Buggy python submission (verdict: Runtime Error):
N,M=int(input())
L=list(map(int,input().split()))
B=[1]*N
for i in range(M):
  a,b=map(int,input().split())
  if L[a-1]<L[b-1]:
    B[a-1]==0
  elif L[a-1]==L[b-1]:
    B[a-1]=0
    B[b-1]=0
  else:
    B[b-1]=0
print(sum(B))
  

Fixed submission:
N,M=map(int,input().split())
L=list(map(int,input().split()))
B=[1]*N
for i in range(M):
  a,b=map(int,input().split())
  if L[a-1]<L[b-1]:
    B[a-1]=0
  elif L[a-1]==L[b-1]:
    B[a-1]=0
    B[b-1]=0
  else:
    B[b-1]=0
print(sum(B))
Buggy python submission (verdict: Runtime Error):
N=int(input())
for A in range(-118,120):
  for B in range(-119.119):
    if A**5-B**5==N:
      print(A,B)


Fixed submission:
N=int(input())
for A in range(-118,120):
  for B in range(-119,119):
    if A**5-B**5==N:
      print(A,B)
      exit()

Buggy python submission (verdict: Runtime Error):
N=int(input())
for A in range(-118,120):
  for B in range(-119.119):
    if A**5-B**5==N:
      print(A,B)

Fixed submission:
N=int(input())
for A in range(-118,120):
  for B in range(-119,119):
    if A**5-B**5==N:
      print(A,B)
      exit()
Buggy python submission (verdict: Runtime Error):
A,B,N=map(int,input().split())
x=min(B-1,N)
print(int(A*x/B)-A*int(x/B))


Fixed submission:
K=int(input())
A,B=map(int,input().split())
for i in range(A,B+1):
  if i%K==0:
    print("OK")
    exit()
print("NG")
Buggy python submission (verdict: Runtime Error):
A,B,N=map(int,input().split())
x=min(B-1,N)
print(int(A*x/B)-A*int(x/B)


Fixed submission:
A,B,N=map(int,input().split())
x=min(B-1,N)
print(int(A*x/B))
Buggy python submission (verdict: Runtime Error):
N=int(input())
L=[]
for i for range(N):
  L.append(str(input()))
A=list(set(L))
print(len(A))

Fixed submission:
N=int(input())
L=[]
for i in range(N):
  L.append(str(input()))
A=list(set(L))
print(len(A))
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=list(map(int,input().split()))
B=set(A)
for i in range(1,N+1):
  if i not in B:
    print(0)
  else:
    print(A.count(i))


Fixed submission:
N=int(input())
A=list(map(int,input().split()))
B=[0]*(N+1)
for i in A:
  B[i]+=1
for j in range(1,N+1):
  print(B[j])

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=list(map(int,input().split()))
B=set(A)
for i in range(1,N+1):
  if i not in B:
    print(0)
  else:
    print(A.count(i))


Fixed submission:
N=int(input())
A=list(map(int,input().split()))
B=[0]*(N+1)
for i in A:
  B[i]+=1
for j in range(1,N+1):
  print(B[j])

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()))
B=[0]*(N+1)
for i in A:
  B[i]+=1
for j in range(1,N+1):
  print(B[j])
Buggy python submission (verdict: Time Limit Exceeded):
K=int(input())
import math
p=0
for i in range(1,K+1):
  for j in range(1,K+1):
    for k in range(1,K+1):
      p+=math.gcd(i,math.gcd(j,k))
print(p)

Fixed submission:
K=int(input())
import math
def f(x):
  if x==1:
    return 1
  elif x==2:
    return 9
  else:
    m=0
    for j in range(1,x):
      m+=math.gcd(j,x)*6
    for i in range(1,x-1):
      for k in range(i+1,x):
        m+=math.gcd(x,math.gcd(i,k))*6
    return m+x+f(x-1)
print(f(K))
Buggy python submission (verdict: Runtime Error):
K,N=int(map(int,input().split()))
A=list(map(int,input().split()))
m=K
for j in range(len(a)):
  m=min(m,min(K-abs(A[j]-A[j-1]),K-abs(A[j]-A[j+1])))
print(m)
              
                                              


Fixed submission:
S=str(input())
if S[2]==S[3] and S[4]==S[5]:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
K,N=int(map(int,input().split()))
A=list(map(int,input().split()))
m=K
for j in range(len(A)):
  m=min(m,min(K-abs(A[j]-A[j-1]),K-abs(A[j]-A[j+1])))
print(m)
              
                                              


Fixed submission:
K,N=map(int,input().split())
A=list(map(int,input().split()))
m=K
for i in range(N):
  if i==0:
    m=min(m,A[N-1]-A[0])
  else:
    b=A[N-1]-A[i]+K-A[N-1]+A[i-1]
    m=min(m,b)
print(m)

Buggy python submission (verdict: Runtime Error):
K,N=int(map(int,input().split()))
A=list(map(int,input().split()))
m=K
for j in range(len(N)):
  m=min(m,min(K-abs(N[j]-N[j-1]),K-abs(N[j]-N[j+1])))
print(m)
              
                                              

Fixed submission:
K,N=map(int,input().split())
A=list(map(int,input().split()))
m=K
for i in range(N):
  if i==0:
    m=min(m,A[N-1]-A[0])
  else:
    b=A[N-1]-A[i]+K-A[N-1]+A[i-1]
    m=min(m,b)
print(m)
Buggy python submission (verdict: Runtime Error):
N,X,Y=map(int,input().split())
N=[0]*(N+1)
for i in range(1,N):
  for j in range(i+1,N+1):
    m=min(j-i,abs(Y-j)+abs(X-i)+1)
    N[m]+=1
for k in range(1,N):
  print(A[k])


Fixed submission:
N,X,Y=map(int,input().split())
A=[0]*(N+1)
for i in range(1,N):
  for j in range(i+1,N+1):
    m=min(j-i,abs(Y-j)+abs(X-i)+1)
    A[m]+=1
for k in range(1,N):
  print(A[k])

Buggy python submission (verdict: Runtime Error):
N=int(input())
N=[0]*(N+1)
for i in range(1,N):
  for j in range(i+1,N+1):
    m=min(j-i,abs(Y-j)+abs(X-i)+1)
    N[m]+=1
for k in range(1,N):
  print(A[k])


Fixed submission:
N,X,Y=map(int,input().split())
A=[0]*(N+1)
for i in range(1,N):
  for j in range(i+1,N+1):
    m=min(j-i,abs(Y-j)+abs(X-i)+1)
    A[m]+=1
for k in range(1,N):
  print(A[k])

Buggy python submission (verdict: Runtime Error):
N=int(input())
N=[0]*(N+1)
for i in range(1,N):
  for j in range(i+1,N+1):
    m=min(j-i,abs(Y-j)+abs(X-i)+1)
    N[m]+=1
for k in range(1,N+1):
  print(A[k])

Fixed submission:
N,X,Y=map(int,input().split())
A=[0]*(N+1)
for i in range(1,N):
  for j in range(i+1,N+1):
    m=min(j-i,abs(Y-j)+abs(X-i)+1)
    A[m]+=1
for k in range(1,N):
  print(A[k])
Buggy python submission (verdict: Runtime Error):
L=int(input())
a=L/3
b=a**3
print("{;.12f}".format(b))

Fixed submission:
L=int(input())
a=L/3
b=a**3
print("{:.12f}".format(b))

Buggy python submission (verdict: Runtime Error):
L=int(input())
a=L/3
b=a**3
print(b[:.13f])

Fixed submission:
L=int(input())
a=L/3
b=a**3
print("{:.12f}".format(b))
Buggy python submission (verdict: Runtime Error):
S,T=map(str(input().split()))
M=str(T)+str(S)
print(M)


Fixed submission:
S,T=map(str,input().split())
print(T+S)

Buggy python submission (verdict: Runtime Error):
S,T=map(str(input().split()))
print(str(T)+str(S))

Fixed submission:
S,T=map(str,input().split())
print(T+S)
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
if N<=10:
  if N==7 or N==9 or N==10:
    print(1)
    exit()
  else:
    print(0)
    exit()
if N%2==0:
  A=[2]
else:
  A=[1]
i=A[0]+2
while i<=N:
  A.append(i)
  i+=2
a=0
m=1
while len(A)!=0:
    A=[A[i] for i in range(len(A)) if A[i]%(5**m)==0]
    a+=len(A)
    m+=1
print(a)


Fixed submission:
N=int(input())
if N%2==1:
  print(0)
  exit()
m=10
a=0
while m<=N:
  a+=N//m
  m=m*5
print(a)

Buggy python submission (verdict: Runtime Error):
N=int(input())
import numpy as np
if N<=10:
  if N==7 or N==9 or N==10:
    print(1)
    exit()
  else:
    print(0)
    exit()
if N%2==0:
  A=[2]
else:
  A=[1]
i=A[0]+2
while i<=N:
  A.append(i)
  i+=2
A=np.array(A)
a=0
m=1
while len(A)!=0:
    A=A[A%(5**m)==0]
    a+=len(A)
    m+=1
print(a)


Fixed submission:
N=int(input())
if N%2==1:
  print(0)
  exit()
m=10
a=0
while m<=N:
  a+=N//m
  m=m*5
print(a)

Buggy python submission (verdict: Runtime Error):
N=int(input())
import numpy as np
if N<=10:
  if N==7 or N==9 or N==10:
    print(1)
    exit()
  else:
    print(0)
    exit()
if N%2==0:
  A=[2]
else:
  A=[1]
i=A[0]+2
while i<=N:
  A.append(i)
  i+=2
A=np.array(A)
a=0
m=1
while len(A)!=0:
    A=A[A%(5**m)==0]
    a+=len(A)
    m+=1
print(a)


Fixed submission:
N=int(input())
if N%2==1:
  print(0)
  exit()
m=10
a=0
while m<=N:
  a+=N//m
  m=m*5
print(a)
Buggy python submission (verdict: Runtime Error):
N=int(input())
for i in range(1,N//(1.08)+3): #X
  if int(i*1.08)==N:
    print(i)
    exit()
print(":(")

  

Fixed submission:
N=int(input())
for i in range(1,N+1):
  if int(i*1.08)==N:
    print(i)
    exit()
print(":(")
Buggy python submission (verdict: Runtime Error):
N=int(input())
if N>81:
  print("No")
else:
  i=1
  while N%i!=0 and i<10
    i+=1
  if i==10:
    print("No")
  else:
    print("Yes")
    


Fixed submission:
N=int(input())
for j in range(1,10):
    for i in range(1,10):
        if N==i*j:
            print("Yes")
            exit()
print("No")

Buggy python submission (verdict: Runtime Error):
N=int(input())
if N>81:
  print("No")
else:
  i=1
  while N%i!=0 and i<10
    i+1
  if i==10:
    print("No")
  else:
    print("Yes")
    

Fixed submission:
N=int(input())
for j in range(1,10):
    for i in range(1,10):
        if N==i*j:
            print("Yes")
            exit()
print("No")
Buggy python submission (verdict: Runtime Error):
import math
N=int(input())
m=N+1
for j in range(2,math.sqrt(N)):
    if N%j==0:
        a=j
        b=N//j
        if a>b:
            break
        else:
            m=min(m,(a+b))

print(m-2)


Fixed submission:
import math
N=int(input())
m=N+1
for j in range(2,int(math.sqrt(N))+1):
    if N%j==0:
        a=j
        b=N//j
        if a>b:
            break
        else:
            m=min(m,(a+b))

print(m-2)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
m=N+1
for j in range(2,N//2+1):
  if N%j==0:
    a=j
    b=N//j
    if a>b:
      break
    else:
      m=min(m,(a+b))

print(m-2)

Fixed submission:
import math
N=int(input())
m=N+1
for j in range(2,int(math.sqrt(N))+1):
    if N%j==0:
        a=j
        b=N//j
        if a>b:
            break
        else:
            m=min(m,(a+b))

print(m-2)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
m=N+1
for i in range(1,N//2+1):
    for j in range(2,N//2+1):
        if i*j==N:
            m=min(m,(i+j))
print(m-2)
 

Fixed submission:
import math
N=int(input())
m=N+1
for j in range(2,int(math.sqrt(N))+1):
    if N%j==0:
        a=j
        b=N//j
        if a>b:
            break
        else:
            m=min(m,(a+b))

print(m-2)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
x=[]
m=N+1
for i in range(2,N//2+1):
    if N%i==0:
        a=i
        b=N//i
        m=min(m,a+b)

print(m-2)


Fixed submission:
import math
N=int(input())
m=N+1
for j in range(2,int(math.sqrt(N))+1):
    if N%j==0:
        a=j
        b=N//j
        if a>b:
            break
        else:
            m=min(m,(a+b))

print(m-2)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
x=[]
m=N+1
x.append(set([1,N]))
for i in range(2,N//2+1):
    if N%i==0:
        a=i
        b=N//i
        m=min(m,a+b)
        if set([a,b]) in x:
            break
        else:
            x.append(set([a,b]))

print(m-2)

Fixed submission:
import math
N=int(input())
m=N+1
for j in range(2,int(math.sqrt(N))+1):
    if N%j==0:
        a=j
        b=N//j
        if a>b:
            break
        else:
            m=min(m,(a+b))

print(m-2)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
x=[]
m=N+1
x.append(set([1,N]))
for i in range(2,N):
    if N%i==0:
        a=i
        b=N//i
        m=min(m,a+b)
        if set([a,b]) in x:
            break
        else:
            x.append(set([a,b]))

print(m-2)
 

Fixed submission:
import math
N=int(input())
m=N+1
for j in range(2,int(math.sqrt(N))+1):
    if N%j==0:
        a=j
        b=N//j
        if a>b:
            break
        else:
            m=min(m,(a+b))

print(m-2)
Buggy python submission (verdict: Runtime Error):
A,B=int(int,input().split())
m=A-2*B
if m<0:
  print(0)
else:
  print(m)

Fixed submission:
A,B=map(int,input().split())
m=A-2*B
if m<0:
  print(0)
else:
  print(m)
Buggy python submission (verdict: Runtime Error):
N=int(input())
d+=list(map(int,input().split()))
s=0
for j in range(N-1):
  for i in range(j+1,N):
    s+=d[j]*d[i]
print(s)

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

Fixed submission:
N,K=map(int,input().split())
h=list(map(int,input().split()))
s=0
for i in range(N):
    if h[i]>=K:
        s+=1
print(s)
Buggy python submission (verdict: Runtime Error):
S=str(input())
if S=="Sunny":
  print("Cloudy")
elif S=="Cloudy":
  print("Rainy")
elif S="Rainy":
  print("Sunny")


Fixed submission:
S=input()
if S=="Sunny":
  print("Cloudy")
elif S=="Cloudy":
  print("Rainy")
elif S=="Rainy":
  print("Sunny")

Buggy python submission (verdict: Runtime Error):
S=input()
if S=="Sunny":
  print("Cloudy")
elif S=="Cloudy":
  print("Rainy")
elif S="Rainy":
  print("Sunny")

Fixed submission:
S=input()
if S=="Sunny":
  print("Cloudy")
elif S=="Cloudy":
  print("Rainy")
elif S=="Rainy":
  print("Sunny")
Buggy python submission (verdict: Runtime Error):
S=input()
i=0
while i<len(S):
  if i%2=0:
    if S[i]=="L":
      print("No")
      exit()
    else:
      i+=1
  else:
    if S[i]=="R":
      print("No")
    else:
      i+=1
print("Yes")

Fixed submission:
S=input()
i=0
while i<len(S):
  if i%2==0:
    if S[i]=="L":
      print("No")
      exit()
    else:
      i+=1
  else:
    if S[i]=="R":
      print("No")
      exit()
    else:
      i+=1
print("Yes")

Buggy python submission (verdict: Runtime Error):
S=str(input())
for i in range(len(S)):
  if i%2==0:
    S.replace("R","Q")
  else:
    S.replace("L","Q")
S.replace("U","")
S.replace("D","")
S.replace("Q","")
if S="":
  print("Yes")
else:
  print("No")
    

  


Fixed submission:
S=input()
i=0
while i<len(S):
  if i%2==0:
    if S[i]=="L":
      print("No")
      exit()
    else:
      i+=1
  else:
    if S[i]=="R":
      print("No")
      exit()
    else:
      i+=1
print("Yes")

Buggy python submission (verdict: Runtime Error):
S=input()
s=0
for i in range(len(S)):
  if i%2==0:
    if S[i]=="R" or "U" or "D":
      s+=1
  else:
    if S[i]="L" or "U" or "D":
      s+=1
if s==len(S):
  print("Yes")
else:
  print("No")
  

Fixed submission:
S=input()
i=0
while i<len(S):
  if i%2==0:
    if S[i]=="L":
      print("No")
      exit()
    else:
      i+=1
  else:
    if S[i]=="R":
      print("No")
      exit()
    else:
      i+=1
print("Yes")
Buggy python submission (verdict: Runtime Error):
N,K,Q=map(int,input().split())
L=[K-Q]*N
for j in range(Q):
  A=int(input())
  L[A]+=1
for i in L:
  if i>0:
    print("Yes")
  else:
    print("No")

Fixed submission:
N,K,Q=map(int,input().split()) #Nは人の人数、Kはみなが最初に持っているポイント、Qはクイズの回数
L=[K-Q]*N #
for i in range(Q):
    m=int(input())-1
    L[m]+=1
for k in range(N):
    if L[k]>0:
        print("Yes")
    else:
        print("No")

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

Fixed submission:
N,K,Q=map(int,input().split()) #Nは人の人数、Kはみなが最初に持っているポイント、Qはクイズの回数
L=[K-Q]*N #
for i in range(Q):
    m=int(input())-1
    L[m]+=1
for k in range(N):
    if L[k]>0:
        print("Yes")
    else:
        print("No")

Buggy python submission (verdict: Time Limit Exceeded):
N,K,Q=map(int,input().split()) #Nは人の人数、Kはみなが最初に持っているポイント、Qはクイズの回数
L=[K]*N
for i in range(Q):
  m=int(input())-1
  for j in range(N):
    if j!=m:
      L[j]-=1
for k in range(N):
  if L[k]>0:
    print("Yes")
  else:
    print("No")


Fixed submission:
N,K,Q=map(int,input().split()) #Nは人の人数、Kはみなが最初に持っているポイント、Qはクイズの回数
L=[K-Q]*N #
for i in range(Q):
    m=int(input())-1
    L[m]+=1
for k in range(N):
    if L[k]>0:
        print("Yes")
    else:
        print("No")

Buggy python submission (verdict: Runtime Error):
N,K,Q=map(int,input().split()) #Nは人の人数、Kはみなが最初に持っているポイント、Qはクイズの回数
L=[K]*N
for i in range(Q):
  m=int(input())-1
  for j in range(N):
    if j!=m:
      L[i]-=1
for k in range(N):
  if L[k]>0:
    print("Yes")
  else:
    print("No")

Fixed submission:
N,K,Q=map(int,input().split()) #Nは人の人数、Kはみなが最初に持っているポイント、Qはクイズの回数
L=[K-Q]*N #
for i in range(Q):
    m=int(input())-1
    L[m]+=1
for k in range(N):
    if L[k]>0:
        print("Yes")
    else:
        print("No")
Buggy python submission (verdict: Runtime Error):
print(N**3)

Fixed submission:
N=int(input())
print(N**3)

Buggy python submission (verdict: Runtime Error):
def n:
  return n**3


Fixed submission:
N=int(input())
print(N**3)
Buggy python submission (verdict: Runtime Error):
N=int(input())
S=list(map(int,input().split()))
a=[]
for i in range(N-1):
    j=i
    m=0
    while j<N-1 and S[j]>=S[j+1]:
        m+=1
        j+=1
    a.append(m)
print(max(a))

Fixed submission:
N=int(input())
S=list(map(int,input().split()))
a=[]
i=0 #リスト
m=0
while i<N-1:
    if S[i]>=S[i+1]:
        m+=1
        if i<N-3:
            if S[i+1]<S[i+2]:
                a.append(m)
                m=0
    i+=1
a.append(m)
print(max(a))

Buggy python submission (verdict: Runtime Error):
N=int(input())
S=list(map(int,input().split()))
a=[]
for i in range(N-1):
    j=i
    m=0
    while S[j]>=S[j+1] and j<N-1:
        m+=1
        j+=1
    a.append(m)
print(max(a))

Fixed submission:
N=int(input())
S=list(map(int,input().split()))
a=[]
i=0 #リスト
m=0
while i<N-1:
    if S[i]>=S[i+1]:
        m+=1
        if i<N-3:
            if S[i+1]<S[i+2]:
                a.append(m)
                m=0
    i+=1
a.append(m)
print(max(a))
Buggy python submission (verdict: Runtime Error):
N=int(input())
v=list(map(int,input().split()))
v.sort()
if len(v)==1:
    print(v[0])
elif len(v)==2:
    print((v[0]+v[1])/2)
else:
    s+=0
    s+=(v[0]+v[1])/2
    for j in range(2,N):
        s+=v[j]/(2**(N+1-j))    
    print(s)

Fixed submission:
N=int(input())
v=list(map(int,input().split()))
v.sort()
s=v[0]
for j in range(1,N):
    s=(s+v[j])/2
print(s)

Buggy python submission (verdict: Runtime Error):
N=int(input())
v=list(map(int,input().split()))
v.sort()
if len(v)==1:
    print(v[0])
elif len(v)==2:
    print((v[0]+v[1])/2)
else:
    s+=0
    s+=(v[0]+v[1])/2
    for j in range(2,N):
        s+=v[j]/(2**(N+1-j))    
    print(s)

Fixed submission:
N=int(input())
v=list(map(int,input().split()))
v.sort()
s=v[0]
for j in range(1,N):
    s=(s+v[j])/2
print(s)

Buggy python submission (verdict: Runtime Error):
N=int(input())
v=list(map(int,input().split()))
v.sort()
if len(v)==1:
    print(v[0])
elif len(v)==2:
    print(float((v[0]+v[1])/2))
else:
    s=(float((v[0]+v[1])/2))
    for j in range(2,N):
        s=float((s+v[j])/2) 
print(s)

Fixed submission:
N=int(input())
v=list(map(int,input().split()))
v.sort()
s=v[0]
for j in range(1,N):
    s=(s+v[j])/2
print(s)

Buggy python submission (verdict: Runtime Error):
N=int(input())
v=list(map(int,input().split()))
s=0
v.sort()
if len(v)==1:
  print(v[0])
elif len(v)==2:
  print(sum(v)/2)
else:
  s+=(v[0]+[1])/(2**N-1)
  for j in range(2,N):
    s+=v[j]/(2**N-j)
print(s)


Fixed submission:
N=int(input())
v=list(map(int,input().split()))
v.sort()
s=v[0]
for j in range(1,N):
    s=(s+v[j])/2
print(s)

Buggy python submission (verdict: Runtime Error):
N=int(input())
v=list(map(int,input().split()))
s=0
v.sort()
if len(v)=1:
  print(v[0])
elif len(v)=2:
  print(sum(v)/2)
else:
  s+=(v[0]+[1])/(2**N-1)
  for j in range(2,N):
    s+=v[j]/(2**N-j)
print(s)


Fixed submission:
N=int(input())
v=list(map(int,input().split()))
v.sort()
s=v[0]
for j in range(1,N):
    s=(s+v[j])/2
print(s)
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
q=[]  
for i in range(N):
    q+=[list(input())]
    q[i].sort()
    q.sort()
m=0
s=0
z=0 #総得点
while m<N-1:
    if q[m]!=q[m+1]:
        z+=((s*(s+1))//2)
        s=0
    else:
        s+=1
    m+=1
z+=((s*(s+1))//2)
print(z)

Fixed submission:
N=int(input())
q=[]  
for i in range(N):
    q+=[list(input())]
    q[i].sort()
q.sort() 
i=0
s=0
z=0 #総得点
while i<N-1:
    if q[i]!=q[i+1]:
        z+=((s*(s+1))//2)
        s=0
    else:
        s+=1
    i+=1
z+=((s*(s+1))//2)
print(z)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
q=[]
for i in range(N):
    q+=[list(input())]
    q[i].sort()
s=0
for j in range(N-1):
    for k in range(j+1,N):
        if q[j]==q[k]:
            s+=1
print(s)

Fixed submission:
N=int(input())
q=[]  
for i in range(N):
    q+=[list(input())]
    q[i].sort()
q.sort() 
i=0
s=0
z=0 #総得点
while i<N-1:
    if q[i]!=q[i+1]:
        z+=((s*(s+1))//2)
        s=0
    else:
        s+=1
    i+=1
z+=((s*(s+1))//2)
print(z)
Buggy python submission (verdict: Time Limit Exceeded):
L,R=map(int,input().split())
m=((L%2019)*((L+1)%2019))%2019
for i in range(L,R):
  for j in range(i+1,R+1):
    s=((i%2019)*(j%2019))%2019
    m=min(s,m)
print(m)

Fixed submission:
L,R=map(int,input().split())
if L%2019==0 or R%2019==0:
  print(0)
else:
  start=L%2019
  end=R%2019
  if start>=end or R-L>=2018: #中に2019の倍数が含まれるとき
    print(0)
  else:
    m=(L*(L+1))%2019
    for i in range(L,R):
      for j in range(i+1,R+1):
        s=(i*j)%2019
        m=min(m,s)
    print(m)

Buggy python submission (verdict: Time Limit Exceeded):
L,R=map(int,input().split())
m=(L*(L+1))%2019
for i in range(L,R):
    for j in range(i+1,R+1):
        s=(i*j)%2019
        m=min(m,s)
print(m)


Fixed submission:
L,R=map(int,input().split())
if L%2019==0 or R%2019==0:
  print(0)
else:
  start=L%2019
  end=R%2019
  if start>=end or R-L>=2018: #中に2019の倍数が含まれるとき
    print(0)
  else:
    m=(L*(L+1))%2019
    for i in range(L,R):
      for j in range(i+1,R+1):
        s=(i*j)%2019
        m=min(m,s)
    print(m)

Buggy python submission (verdict: Runtime Error):
L,R=map(int,input().split())
m=(L*(L+1))%2019
for i in range(L,R):
  for j in rang(i+1,R+1):
    s=(i*j)%2019
    m=min(m,s)
print(m)


Fixed submission:
L,R=map(int,input().split())
if L%2019==0 or R%2019==0:
  print(0)
else:
  start=L%2019
  end=R%2019
  if start>=end or R-L>=2018: #中に2019の倍数が含まれるとき
    print(0)
  else:
    m=(L*(L+1))%2019
    for i in range(L,R):
      for j in range(i+1,R+1):
        s=(i*j)%2019
        m=min(m,s)
    print(m)

Buggy python submission (verdict: Runtime Error):
L,R=map(int,input().split())
m=(L*(L+1))%2019
for i in range(L,R):
  for j in rang(L+1,R+1):
    s=(i*j)%2019
    m=min(m,s)
print(m)

Fixed submission:
L,R=map(int,input().split())
if L%2019==0 or R%2019==0:
  print(0)
else:
  start=L%2019
  end=R%2019
  if start>=end or R-L>=2018: #中に2019の倍数が含まれるとき
    print(0)
  else:
    m=(L*(L+1))%2019
    for i in range(L,R):
      for j in range(i+1,R+1):
        s=(i*j)%2019
        m=min(m,s)
    print(m)