output_description: Print the expected number of times the operation is performed before all the
  pieces of sushi are eaten. The output is considered correct when the relative
  difference is not greater than 10^{-9}.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N
      a_1 a_2 \ldots a_N
attempt: def main():
      N = int(input())
      A = list(map(int, input().split()))
      a = A.count(1)
      b = A.count(2)
      c = A.count(3)]
      floatN = N*1.0
      dp = [[[0]*(N+1) for i in range(N+1)] for j in range(N+1)]
  
      for k in range(A[3]+1):
          for j in range(A[2]+A[3] + 1 - k):
              for i in range(N + 1 - k - j):
                  if i + j+k == 0:
                      continue
                  dp[i][j][k] = floatN
                  if i > 0:
                      dp[i][j][k] += dp[i-1][j][k] * i
                  if j > 0:
                      dp[i][j][k] += dp[i+1][j-1][k] * j
                  if k > 0:
                      dp[i][j][k] += dp[i][j+1][k-1] * k
                  dp[i][j][k] /= (i+j+k)
  
      print(dp[a][b][c])
  main()
  
problem_description: Statement
  
  There are N dishes, numbered 1, 2, \ldots, N. Initially, for each i (1 \leq i
  \leq N), Dish i has a_i (1 \leq a_i \leq 3) pieces of sushi on it.
  
  Taro will perform the following operation repeatedly until all the pieces of
  sushi are eaten:
  
    * Roll a die that shows the numbers 1, 2, \ldots, N with equal probabilities, and let i be the outcome. If there are some pieces of sushi on Dish i, eat one of them; if there is none, do nothing.
  
  Find the expected number of times the operation is performed before all the
  pieces of sushi are eaten.
samples: [{"input": "3\n    1 1 1", "output": "5.5\n    \n\nThe expected number of operations before the first piece of sushi is eaten, is\n1. After that, the expected number of operations before the second sushi is\neaten, is 1.5. After that, the expected number of operations before the third\nsushi is eaten, is 3. Thus, the expected total number of operations is 1 + 1.5\n+ 3 = 5.5.\n\n* * *"}, {"input": "1\n    3", "output": "3\n    \n\nOutputs such as `3.00`, `3.000000003` and `2.999999997` will also be accepted.\n\n* * *"}, {"input": "2\n    1 2", "output": "4.5\n    \n\n* * *"}, {"input": "10\n    1 3 2 3 3 2 3 2 1 3", "output": "54.48064457488221"}]