#ABC470E. 集中 / Concentration

集中 / Concentration

Problem Statement

Takahashi is playing a solitaire game similar to the memory-matching game.

There are 2N2N cards. A number is written on the front of each card, and nothing is written on the back.
For each ii satisfying 1iN1 \leq i \leq N, there are exactly two cards on which AiA_i is written. (The AiA_i are pairwise distinct.)

Takahashi plays the game with these cards using the following procedure.

  • Shuffle the 2N2N cards and lay them out face down.
  • Set life to LL and score to 00.
  • Repeat the following until life becomes 00 or there are no cards left on the table:
    • Choose one face-down card on the table, turn it face up, and check the number XX written on it.
    • Choose one face-down card on the table, turn it face up, and check the number YY written on it.
    • If X=YX=Y, remove those two cards from the table, and increase the score by XX.
    • If XYX\neq Y, turn the two cards face down again, and decrease life by 11.

Find the expected value of the score at the end of the game when Takahashi acts optimally to maximize the score at the end of the game.

Below is a more formal description of the game.

  • Takahashi knows the rules of this game described below.
  • Takahashi knows the values of A1,,ANA_1,\dots,A_N.
  • Let BB be a sequence obtained by choosing a permutation of the length-2N2N sequence (A1,A1,A2,A2,,AN,AN)(A_1,A_1,A_2,A_2,\ldots,A_N,A_N) uniformly at random.
  • Initially, Takahashi knows none of the values of BB. Once he learns the value of BiB_i, he remembers it completely thereafter.
  • Let life be LL, score be 00, and SS be {1,2,3,,2N}\{1,2,3,\ldots,2N\}. Takahashi always knows these values.
  • Repeat the following until life becomes 00 or SS becomes empty:
    • Based on the information obtained up to this point, Takahashi chooses an element from SS, and calls it ii.
    • The value of BiB_i is revealed, and Takahashi learns it.
    • Based on the information obtained up to this point (including the value of BiB_i), Takahashi chooses an element from S{i}S\setminus\{i\}, and calls it jj.
    • The value of BjB_j is revealed, and Takahashi learns it.
    • If Bi=BjB_i=B_j, remove ii and jj from SS, and add BiB_i to the score.
    • If BiBjB_i \neq B_j, decrease life by 11.
  • Takahashi acts optimally to maximize the expected value of the score at the end of the game.

Constraints

  • 1N2001 \leq N \leq 200
  • 1L2001 \leq L \leq 200
  • 1A1<A2<<AN1051 \leq A_1 < A_2 < \dots < A_N \leq 10^5
  • All input values are integers.

Input

The input is given from Standard Input in the following format:

$N$ $L$
$A_1$ $A_2$ $\dots$ $A_N$

Output

Output the answer.
Your output will be considered correct if its absolute or relative error from the true answer is at most 10510^{-5}.


3 2
1 2 3
3.8666666667

The game may proceed as follows, for example. To distinguish the six cards, let us call them A, B, C, D, E, F.

  • Start the game with life 22 and score 00.
  • Turn card A face up. 33 is written on it.
  • Turn card B face up. 22 is written on it.
  • Since different numbers are written, turn both cards face down again, and decrease life by 11 to 11.
  • Turn card C face up. 33 is written on it.
  • Turn card A face up. 33 is written on it.
  • Since the same number is written, remove both cards from the table, and increase the score by 33 to 33.
  • Turn card D face up. 11 is written on it.
  • Turn card E face up. 22 is written on it.
  • Since different numbers are written, turn both cards face down again, and decrease life by 11 to 00.
  • Since life has become 00, the game ends. The score is 33.

Note that, immediately after turning card C face up in this sequence, Takahashi can make the choice of "turning face up card A, the other already-known card with 33 written on it, based on the fact that 33 was written on the front of card C."


5 2
2 3 5 7 101
17.8560846561

20 10
10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 160 170 180 190 200
770.7122293087