Harryxun/stf_run huggingface dataset:
N=int(input())
L=[input() for i in range(n)]
M=set(L)
print(len(M))

### FIXED CODE ###

N=int(input())
S=[input() for i in range (N)]
L=list(S)
M=list(set(L))
j=len(M)
print(j)
a,b,c = map(str,input().split())
print((a[0],b[0],c[0]).upper())

### FIXED CODE ###

a,b,c = map(str,input().split())
print((a[0]+b[0]+c[0]).upper())
N=int(input())
S=[[] for _ in range(N)]
for i in range(N-1):
  a,b=map(int, input().split())
  S[a-1].append((b-1, i))
  S[b-1].append((a-1, i))

L=[0]*(N-1)


def dfs(node, pre_col,pre_node, L):
  col=1
  for next_node, i in S[node]:
    if next_node==pre_node:
      continue
    if col==pre_col:
      col+=1
    L[i]=col
    dfs(next_node, col, node, L)
    col+=1
  return

dfs(0,-1,-1,L)
print(max(L))
for l in L:
  print(l)

### FIXED CODE ###

N=int(input())
#再起のlimitを上げる
import sys
sys.setrecursionlimit(4100000)
S=[[] for _ in range(N)]
for i in range(N-1):
  a,b=map(int, input().split())
  S[a-1].append((b-1, i))
  S[b-1].append((a-1, i))

L=[0]*(N-1)


def dfs(node, pre_col,pre_node):
  col=1
  for next_node, i in S[node]:
    if next_node==pre_node:
      continue
    if col==pre_col:
      col+=1
    L[i]=col
    dfs(next_node, col, node)
    col+=1

dfs(0,-1,-1)

print(max(L))
for l in L:
  print(l)
A, B = map(int, input().split())
D = set()
E =[]
total = A
for i in range(B):
    C = int(input())
    D = map(int, input().split())
    E.append(list(D))
for i in range(1, A+1):
  if str(i) in str(E):
    total = total - 1
print(total)

### FIXED CODE ###

I = input()
print("ABC" if I == "ARC" else "ARC")
a=[]
a.append(s)

while 1:
    if s%2==0:
        s=s/2
        a.append(s)
    else:
        s=3*s+1
        a.append(s)
    if len(a)!=len(set(a)):
        print(len(a))
        exit()

### FIXED CODE ###

s=int(input())
a=[]
a.append(s)

while 1:
    if s%2==0:
        s=s/2
        a.append(s)
    else:
        s=3*s+1
        a.append(s)
    if len(a)!=len(set(a)):
        print(len(a))
        exit()
N = int(input())
A = list(map(int, input().split()))

flag = 0

for i in range(N):
    if A[i] % 2 == 0:
        if A[i] % 3 == 0 or A[i] % 5 == 0:
            pass
        else:
            flag = 1
            break
        
 if flag = 0:
    print("PASS")
 else:
    print("DENIED")

### FIXED CODE ###

a = set(map(int, input().split()))
if len(a) == 2:
  print("Yes")
else:
  print("No")
N=int(input())
x=list(map(int,input().split()))
n=N//2

X=sorted(x)
#print(X)

#print(X[n-1])
#print(X[n])

print(X[n]-X[n-1]

### FIXED CODE ###


N=int(input())
x=list(map(int,input().split()))
n=N//2

X=sorted(x)
#print(X)

#print(X[n-1])
#print(X[n])

print(X[n]-X[n-1])
from heapq import*
(n,m),*t=[map(int,s.split())for s in open(0)]
q=[0]*m
v=[[]for _ in q]
z=0
for a,b in t:v[a-1]+=[b]
for i in v:
	for j in i:heappush(q,-j)
	z-=heappop(q)
print(z)

### FIXED CODE ###

import sys
input = sys.stdin.readline
n,m = map(int,input().split())
chk = []
for i in range(n):
  a,b =  map(int,input().split())
  if a <= m:
    chk.append((a,b))

from heapq import heappop, heappush
from operator import itemgetter
chk = sorted(chk,key=itemgetter(0),reverse=True)

q = []
ans = 0
for i in range(1, m + 1):
    while chk and chk[-1][0] <= i:
        a,b = chk.pop()
        heappush(q,-b)
    if q:
        ans -= heappop(q)
print(ans)
a,b,c=map(int, input().split())

if a-b==0 
  print(int(c))
elif b-c==0:
  print(int(a))
elif c-a==0:
  print(int(b))


### FIXED CODE ###

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

if a-b==0: 
  print(int(c))
elif b-c==0:
  print(int(a))
elif c-a==0:
  print(int(b))
n = input()
print(n*n*n)


### FIXED CODE ###

n = int(input())
print(n*n*n)
N, K = map(int, input().split())
c = []

for _ in range(N):
    a, b= map(int, input().split())
    for i in range(b):
        c.append(a)
    if d <= K:
        break
        
print(sorted(c)[K-1])

### FIXED CODE ###

N, K = map(int, input().split())
num = [0]*(10**5+1)
for i in range(N):
    a, b= map(int, input().split())
    num[a] += b
for i in range(1, 10**5+1):
    if K <= num[i]:
        print(i)
        exit()
    K -= num[i]
# -*- coding: utf-8 -*-
A,B=map(int,input().split())
if A <= 8 and B <= 8:
  print(Yay!)
else:
  print(:()

### FIXED CODE ###

# -*- coding: utf-8 -*-
A,B =map(int,input().split())
if A <= 8 and B <= 8:
  print("Yay!")
else:
  print(":(")
N, M, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

a, b = [0], [0]
for i in range(N):
    a.append(a[i] + A[i])
for i in range(M):
    b.append(a[i] + A[i])

ans, j = o, M

for i in range(N + 1):
    if a[i] > K:
        break
    while b[j] > K - a[i]:
        j -= 1
    ans = max(ans, i + j)
print(ans)


### FIXED CODE ###

N, M, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

a, b = [0], [0]
for i in range(N):
    a.append(a[i] + A[i])
for i in range(M):
    b.append(b[i] + B[i])

ans, j = 0, M

for i in range(N + 1):
    if a[i] > K:
        break
    while b[j] > K - a[i]:
        j -= 1
    ans = max(ans, i + j)
print(ans)
d,t,s=list(int,input().split())

if d/t<=s:
    print("yes")
else:
    print("No")


### FIXED CODE ###

def dts():
	return list(map(int,input().split()))

d,t,s=dts()

if d>t*s:
    print("No")
else:
    print("Yes")
X = int(input())

a = [int( i/2)*((-1)**i) for i in range(1, 10000)]
b = [int( i/2)*((-1)**i) for i in range(1, 10000)]

"""
* Aが正ならBは負または、Aより小さい正
* Aが負ならBは負
* X/(a+b)は、1以上の整数
"""

find = False
if X == 0:
  print(0)
else:  
  for a_ in a:
    for b_ in b:
      if a_ + b_ == 0:
        continue
      if a_ >= 0:
        if b_ >= 0 or b_ > a_:
          continue
      if a_ < 0:
        if b_ >= 0:
          continue
        
      if X%(a_+b_) != 0:
        continue
      
      if (a_**5) - (b_**5) == X:
        print(f"{a_} {b_}")
        find = True
        break
    if find:
      break


### FIXED CODE ###

c = input()
print("ABC" if c == "ARC" else "ARC")
n = int(input())

if n == 1:
  w = ['a']
elif n == 2:
  w = ['aa','ab']
elif n == 3:
  w = ['aaa','aab','aba','abb','abc']
for s in w:
  print (s)

### FIXED CODE ###

n = int(input())
v = 'abcdefghijk'

w = []
def dfs(s,t):
  if len(s) == n:
    w.append(s)
    return
  u = len(set(s))
  for i in range(u+1):
    dfs(s+v[i],u+1)

dfs('a',1)

for i in w:
  print (i)
def inlt():
    return(list(map(int,input().split())))
  
i <- inlt()
D <- i[0]
T <- i[1]
S <- i[2]

if D/T > S:
  print("No")
else:
  print("Yes")

### FIXED CODE ###

def inp():
    return(int(input()))
def inlt():
    return(list(map(int,input().split())))
def insr():
    s = input()
    return(list(s[:len(s) ]))
def invr():
    return(map(int,input().split()))
  
i = inlt()
D = i[0]
T = i[1]
S = i[2]
 
if D/T > S:
  print("No")
else:
  print("Yes")
N = int(input())
d = [int(input()) for i in range(N)]

point_sum = 0

for n in range(N):
    head = d.pop(0)
    point_sum += sum(list(map(lambda x : x * head, d)))
    
print(point_sum)

### FIXED CODE ###

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

point_sum = 0

for n in range(N):
    head = d.pop(0)
    point_sum += sum(list(map(lambda x : x * head, d)))
    
print(point_sum)
X,N=map(int,input().split())
P=list(map(int,input().split()))

if N==0:
    print(X)
else:
    if X<min(P):
        ans=X
        print(ans)
    
    elif X in range(min(P),max(P)+1):
        #大した大きい数じゃないので全探索すればいい
        ans_len=200 #ひとまずの仮定
        for i in range(min(P),max(P)+1):
            if i in P:
                continue
            else:
                l=abs(X-i)
                if l < ans_len:
                    ans_len=l
                    ans=i
        print(ans)
                
    else:
        ans=X
        print(ans)

### FIXED CODE ###

X,N=map(int,input().split())
P=list(map(int,input().split()))

if N==0:
    print(X)
else:
    if X<min(P):
        ans=X
        print(ans)
    
    elif X in range(min(P),max(P)+1):
        #大した大きい数じゃないので全探索すればいい
        ans_len=200 #ひとまずの仮定
        for i in range(250):
            if i in P:
                continue
            else:
                l=abs(X-i)
                if l < ans_len:
                    ans_len=l
                    ans=i
        print(ans)
                
    else:
        ans=X
        print(ans)
n = int(input())
alist = list(map(int, input().split(" ")))

if 0 in alist:
  print("0")
else:
  result = 1
  m = 0
  while result <= 10**18:
    result *= alist[m]
    m += 1
  if m < n or result > 10**18:
    print("-1")
  else:
    print(result)

### FIXED CODE ###

n = int(input())
alist = list(map(int, input().split(" ")))

if 0 in alist:
  print("0")
else:
  result = 1
  m = 0
  while result <= 10**18 and m < n:
    result *= alist[m]
    m += 1
  if m < n or result > 10**18:
    print("-1")
  else:
    print(result)
h, w = map(int, input().split())

for i in range(h+2):
  if i == 0 or i == h+1:
    print("#"*(w+2))
  else:
    print("#"+input()"#")
	

### FIXED CODE ###

h, w = map(int, input().split())
 
for i in range(h+2):
  if i == 0 or i == h+1:
    print("#"*(w+2))
  else:
    print("#"+input()+"#")
n,k = map(int,input().split())
p = list(map(int,input().split()))

ls = []
ans = 0

for i in range(k):
    ans += p[i]
    
max_ans = ans
max_index = 0

for i in range(n-k):
    ans -= p[i]
    ans += p[i+k]
    if max_ans < ans:
        max_ans = ans
        max_index = i+1

ans = 0
al = []
for i in range(k):
    pp = p[max_index+i]
    if pp = 200000:
        ans += 2000010000.0000002
    else:
        for j in range(pp):
            ans += (1/pp*(j+1))
            al.append(ans)
    
print(ans)
        

### FIXED CODE ###

n,k = map(int,input().split())
p = list(map(int,input().split()))

ls = []
ans = 0

for i in range(k):
    ans += p[i]
    
max_ans = ans
max_index = 0

for i in range(n-k):
    ans -= p[i]
    ans += p[i+k]
    if max_ans < ans:
        max_ans = ans
        max_index = i+1

ans = 0
for i in range(k):
    pp = p[max_index+i]
    for j in range(pp):
        ans += (1/pp*(j+1))
    
print(ans)
#! -*- coding:utf-8 -*-

def search(values,hp,vp,fruit):
	if not (0<=hp<len(values)): return
	if not (0<=vp<len(values[hp])): return
	if values[hp][vp] not in ['@','#','*']: return
	if fruit!=values[hp][vp]: return
	values[hp][vp]=True
	search(values,hp-1,vp,fruit)
	search(values,hp+1,vp,fruit)
	search(values,hp,vp-1,fruit)
	search(values,hp,vp+1,fruit)

def solve(values):
	count=0
	for i in range(len(values)):
		for j in range(len(values[i])):
			if values[i][j] in ['@','#','*']:
				search(values,i,j,values[i][j])
				count+=1
	return count

def main():
	line,values=input(),list()
	while line!='0 0':
		H,W = list(map(int,line.strip().split(' ')))
		value = list()
		for _ in range(H):
			value.append([x for x in input().strip()])
		values.append(value)
		line = input()
	for value in values:
		print(solve(value))

if __name__=='__main__':
	main()

### FIXED CODE ###

# -*- coding: utf-8 -*-

import sys
sys.setrecursionlimit(10**6)

def search(field,hp,vp,item):
	if not (0<=hp<len(field)): return
	if not (0<=vp<len(field[hp])): return
	if item!=field[hp][vp]: return
	field[hp][vp]=True
	for dh,dv in [[0,1],[0,-1],[1,0],[-1,0]]:
		search(field,hp+dh,vp+dv,item)
#	search(field,hp-1,vp,item)
#	search(field,hp+1,vp,item)
#	search(field,hp,vp-1,item)
#	search(field,hp,vp+1,item)

def solve(field):
	count,valid_items=0,set(['@','#','*'])
	for i in range(len(field)):
		for j in range(len(field[i])):
			if field[i][j] in valid_items:
				search(field,i,j,field[i][j])
				count+=1
	return count

def main():
	line = input().strip()
	while line!='0 0':
		H,W = list(map(int,line.split(' ')))
		field = list()
		for _ in range(H):
			field.append(list(input().strip()))
		print(solve(field))
		line = input().strip()

if __name__=='__main__':
	main()
# coding: utf-8
X,Y,Z,K=map(int,input().split())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
C=list(map(int,input().split()))

A.sort(reverse=True)
B.sort(reverse=True)
C.sort(reverse=True)

INF=10**12

DA=[]
DB=[]
DC=[]

for i in range(X-1):
    DA.append(A[i]-A[i+1])
    
for i in range(Y-1):
    DB.append(B[i]-B[i+1])
    
for i in range(Z-1):
    DC.append(C[i]-C[i+1])

SA=[DA[0]]
SB=[DB[0]]
SC=[DC[0]]

for i in range(X-2):
    SA.append(SA[i]+DA[i+1])
    
for i in range(Y-2):
    SB.append(SB[i]+DB[i+1])
    
for i in range(Z-2):
    SC.append(SC[i]+DC[i+1])

SA.append(INF)
SB.append(INF)
SC.append(INF)

A_m=[0]
B_m=[0]
C_m=[0]

A_num=1
B_num=1
C_num=1

while A_num*B_num*C_num<K:
    if SA[0]==min(SA[0],SB[0],SC[0]):
        tmp = SA.pop(0)
        A_m.append(tmp)
        A_num+=1
        
    if SB[0]==min(SA[0],SB[0],SC[0]):
        tmp = SB.pop(0)
        B_m.append(tmp)
        B_num+=1
        
    if SC[0]==min(SA[0],SB[0],SC[0]):
        tmp = SC.pop(0)
        C_m.append(tmp)
        C_num+=1

max_val=A[0]+B[0]+C[0]
cake=[]

for i in range(A_num):
    for j in range(B_num):
        for k in range(C_num):
            cake.append(max_val - A_m[i] - B_m[j] - C_m[k])

cake.sort(reverse=True)

# print(DA,DB,DC)
# print(SA,SB,SC)
# print(A_m,B_m,C_m)

for i in range(K):
    print(cake[i])



### FIXED CODE ###

# coding: utf-8
#解法1 ABのK番まで　＋　CのK番まで
X,Y,Z,K=map(int,input().split())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
C=list(map(int,input().split()))

AB=[]

for i in range(X):
    for j in range(Y):
        AB.append(A[i]+B[j])

AB.sort(reverse=True)
C.sort(reverse=True)

ABC=[]

for i in range(min(K,X*Y)):
    for j in range(min(K,Z)):
        ABC.append(AB[i]+C[j])

ABC.sort(reverse=True)

for i in range(K):
    print(ABC[i])
n = int(input())
s = input()


count_list = []
for index in range(1, len(s) - 1):
    a = s[:index]
    b = s[index:]

    kind_a = set(a)
    kind_b = set(b)

    count = 0
    for c in kind_a:
        if c in kind_b:
            count+=1
    count_list.append(count)

print(max(count_list))


### FIXED CODE ###

n = int(input())
s = input()


count_list = []
for index in range(1, len(s)):
    a = s[:index]
    b = s[index:]

    kind_a = set(a)
    kind_b = set(b)

    count = 0
    for c in kind_a:
        if c in kind_b:
            count+=1
    count_list.append(count)

print(max(count_list))
n, m = map(int, input().split())
A = sorted(map(int, input().split()))
C = []
for _ in range(m):
    b, c = map(int, input().split())
    C += [[-c, b]]
C = sorted(C)
p = 0
for cb in C:
    c, b = -cb[0], cb[1]
    for _ in range(b):
        if A[p] < c:
            A[p] = c
            p += 1
print(sum(A))

### FIXED CODE ###

n, m = map(int, input().split())
A = sorted(map(int, input().split()))
C = []
for _ in range(m):
    b, c = map(int, input().split())
    C += [[-c, b]]
C = sorted(C)
p = 0
for cb in C:
    c, b = -cb[0], cb[1]
    for _ in range(b):
        if (p >= n) | (A[min(p, n-1)] >= c):
            break
        else:
            A[p] = c
            p += 1
print(sum(A))
import itertools
import collections
N,M=map(int,raw_input().split())
#print N,M
a=[tuple(map(int,raw_input().split())) for i in range(N)]
#print a
b=list(itertools.combinations(a,N-1))
#print b

#print collections.Counter(b[0])

cnt=0
for i in b:
	c=[]
	for j,k in i:
		#print j,k
		c.append(j)
		c.append(k)
	#print c
	t_c=collections.Counter(c)
	t_c_v=(collections.Counter(c)).values()
	#print t_c,t_c_v
	if t_c[1]==1:
		for m in t_c_v:
			if m>=3:
				break
		else:
			cnt+=1

print cnt  
	
	 


### FIXED CODE ###

import itertools
import collections
N,M=map(int,raw_input().split())
#print N,M
a=[map(int,raw_input().split()) for i in range(M)]
#print a
b=list(itertools.permutations(range(1,N+1)))
#print b

ans=0
for i in b:
	if i[0]!=1:
		continue
	c=[]
	for j in i:
		#print i,j
		if len(c)<2:
			c.append(j)

		if len(c)==2:
			if c in a or c[::-1] in a:
				cnt=1
			else:
				cnt=0
				break
			c.pop(0)
	ans+=cnt
print ans
#!usr/bin/env python3
from collections import defaultdict, deque
from heapq import heappush, heappop
from itertools import permutations, accumulate
import sys
import math
import bisect
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res
def IR(n):
    return [I() for _ in range(n)]
def LIR(n):
    return [LI() for _ in range(n)]
def SR(n):
    return [S() for _ in range(n)]
def LSR(n):
    return [LS() for _ in range(n)]

sys.setrecursionlimit(1000000)
mod = 1000000007

def solve():
    n = I()
    a = LI()
    b = LI()
    cnt = defaultdict(lambda : 0)
    for i in a:
        cnt[i] += 1
    for i in b:
        if not cnt[i]:
            continue
        cnt[i] += 1
    for i in cnt.values():
        if i > n:
            print("No")
            return
    while 1:
	    r = n-1
        update = False
        for l in range(n):
            while r >= 0 and a[r] != b[r]:
                r -= 1
            if a[l] == b[l]:
                update = True
                b[l],b[r] = b[r],b[l]
                r -= 1
        if not update:
            break
    print("Yes")
    print(*b)
    return

#Solve
if __name__ == "__main__":
    solve()


### FIXED CODE ###

#!usr/bin/env python3
from collections import defaultdict, deque
from heapq import heappush, heappop
from itertools import permutations, accumulate
import sys
import math
import bisect
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res
def IR(n):
    return [I() for _ in range(n)]
def LIR(n):
    return [LI() for _ in range(n)]
def SR(n):
    return [S() for _ in range(n)]
def LSR(n):
    return [LS() for _ in range(n)]

sys.setrecursionlimit(1000000)
mod = 1000000007

def solve():
    n = I()
    a = LI()
    b = LI()
    cnt = defaultdict(lambda : 0)
    for i in a:
        cnt[i] += 1
    for i in b:
        if not cnt[i]:
            continue
        cnt[i] += 1
    for i in cnt.values():
        if i > n:
            print("No")
            return
    r = n-1
    while 1:
        update = False
        for l in range(n):
            while r >= 0 and a[r] != b[r]:
                r -= 1
            if a[l] == b[l]:
                update = True
                b[l],b[r] = b[r],b[l]
                r -= 1
        if not update:
            break
    print("Yes")
    print(*b)
    return

#Solve
if __name__ == "__main__":
    solve()
import sys

N, K = (int(x) for x in input().split())
H = list(map(int, input().split()))
ans=0

if K>=N:
  print(0)
  sys.exit(0)
  
H.sort(reverse=True)
for i in range(K):
  del H[i]
for i in range(len(H)):
  ans+=H[i]
print(ans)

### FIXED CODE ###

import sys

N, K = (int(x) for x in input().split())
H = list(map(int, input().split()))
ans=0

if K>=N:
  print(0)
  sys.exit(0)
  
H.sort(reverse=True)
del H[0:K]
for i in range(len(H)):
  ans+=H[i]
print(ans)
abc=list(map(int,input()))
abc.sort()
print(abc[0]*abc[1])

### FIXED CODE ###

abc=list(map(int,input().split()))
abc.sort()
print(abc[0]*abc[1]//2)
import math

N, M = map(int, input().split())
S = list(input())
T = list(input())

def main(N, M, S, T):
    result = N * M // math.gcd(N, M)
    cand = (result // N) * (result // M) // math.gcd((result // N), (result // M))
    for i in range(0, result // cand):
        print(S[(i * cand + 3) // (result // N) - 1])
        print(T[(i * cand + 3) // (result // M) - 1])
        if S[(i * cand) // (result // N)] != T[(i * cand) // (result // M)]:
            return -1
    return result
print(main(N, M, S, T))

### FIXED CODE ###

def gcd(a, b):
    if a < b:
        a, b = b, a
    if b == 0:
        return a
    c = a % b
    return gcd(b, c)

def main():
    N, M = map(int, input().split())
    S = input()
    T = input()
    result = N * M / gcd(N, M)
    cand = (result / N) * (result / M) / gcd(int((result / N)), int((result / M)))
    for i in range(0, int(result / cand)):
        if S[int((i * cand) / (result / N))] != T[int((i * cand) / (result / M))]:
            return '-1'
    return int(result)
print(main())
import numpy as np


def main():
    N = int(input())
    a = map(int, input().split())
    single = double = triple = 0
    for sushi in a:
        if sushi == 1:
            single += 1
        elif sushi == 2:
            double += 1
        elif sushi == 3:
            triple += 1
    dp = np.zeros((single + 3, double + 3, triple + 3))
    for k in range(triple+2):
        for j in range(double+2):
            for i in range(single + 2):
                if i == 0 and j == 0 and k == 0:
                    continue
                print(i, j, k)
                first = second = third = 0
                if i-1 >= 0 and j >= 0 and k >= 0:
                    first = dp[i - 1][j][k]
                if i+1 >= 0 and j-1 >= 0 and k >= 0:
                    second = dp[i + 1][j - 1][k]
                if i >= 0 and j+1 >= 0 and k-1 >= 0:
                    third = dp[i][j + 1][k - 1]
                dp[i][j][k] = (first*i + second * j +
                               third * k + N) / (i + j + k)
    print(dp[single][double][triple])


if __name__ == "__main__":
    main()


### FIXED CODE ###

def main():
    N = int(input())
    a = map(int, input().split())
    single = double = triple = 0
    for sushi in a:
        if sushi == 1:
            single += 1
        elif sushi == 2:
            double += 1
        elif sushi == 3:
            triple += 1
    dp = [[[0 for i in range(1+single+double+triple-j-k)]
           for j in range(double + triple + 1 - k)] for k in range(triple + 1)]
    for k in range(triple+1):
        for j in range(double + triple + 1-k):
            for i in range(1+single+double+triple-j-k):
                if i == 0 and j == 0 and k == 0:
                    continue
                first = second = third = 0
                if i-1 >= 0 and j >= 0 and k >= 0:
                    first = dp[k][j][i-1]
                if i+1 >= 0 and j-1 >= 0 and k >= 0:
                    second = dp[k][j - 1][i+1]
                if i >= 0 and j+1 >= 0 and k-1 >= 0:
                    third = dp[k-1][j + 1][i]
                dp[k][j][i] = (first*i + second * j +
                               third * k + N) / (i + j + k)
    print(dp[triple][double][single])


if __name__ == "__main__":
    main()
N = int(input())
T, A= map(int, input().split())
H = list(map(int, input().split()))
dH =[]
for i in H:
    dH.append(abs(A - T + 0.006 * i))
min_dH = min(dH)
print(dH.index(min_dH) + 1)

### FIXED CODE ###

X, Y = map(int, input().split())
print(X + Y // 2)
A = int(input())
B = int(input())
C = int(input())
X = int(input()
if ((A+B+C<1) or (A<0 or A>50) or (B<0 or B>50) or (C<0 or C>50) or (X<50 or X > 20000 or X%50!=0)):
    print("条件を満たしてください")
count = 0

for i in range(A+1):
    for j in range(B+1):
        for k in range(C+1):
            Y = i*500 + j*100 + k*50
            if (X==Y):
                count = count+1

print (count)

### FIXED CODE ###

A = int(input())
B = int(input())
C = int(input())
X = int(input())
if ((A+B+C<1) or (A<0 or A>50) or (B<0 or B>50) or (C<0 or C>50) or (X<50 or X > 20000 or X%50!=0)):
    print("条件を満たしてください")
count = 0

for i in range(A+1):
    for j in range(B+1):
        for k in range(C+1):
            Y = i*500 + j*100 + k*50
            if (X==Y):
                count = count+1

print (count)
for a in range(10):

	for b in range(10):
		i = a x b
		print(a,"x" ,b ,"=",i)
	


### FIXED CODE ###

for a in range(1,10):
	for b in range(1,10):
		i = a * b
		print(a,"x",b,"=",i,sep="")