Contest Duration: - (local time) (300 minutes) Back to Home
O - Endurance /

Time Limit: 2 sec / Memory Limit: 1024 MB

### 注意

この問題に対する言及は、2019年12月29日 05:00 JST まで禁止されています。言及がなされた場合、賠償が請求される可能性があります。

### 制約

• 1 \leqq N \leqq 30,000
• 1 \leqq A_{i,j} \leqq {10}^{9}
• A_{i,j} はすべて異なる。
• 入力中の値はすべて整数である。

### 入力

N
A_{1,1} A_{1,2} A_{1,3} A_{1,4} A_{1, 5} A_{1, 6}
A_{2,1} A_{2,2} A_{2,3} A_{2,4} A_{2, 5} A_{2, 6}
:
A_{N,1} A_{N,2} A_{N,3} A_{N,4} A_{N, 5} A_{N, 6}


### 入力例 1

2
1 2 3 4 5 6
7 8 9 10 11 12


### 出力例 1

3.64925355954377


### 入力例 2

3
12 237 374 111 247 234
857 27 98 65 83 90
764 60 999 11 7 4


### 出力例 2

3.42188884244970


### Warning

Do not make any mention of this problem until December 29, 2019, 05:00 a.m. JST. In case of violation, compensation may be demanded.

After the examination, you can reveal your total score and grade to others, but nothing more (for example, which problems you solved).

### Problem Statement

We have N unbiased six-sided dice. The j-th face (1 \leq j \leq 6) of the i-th die (1 \leq i \leq N) has an integer A_{i,j} written on it.

Takahashi repeats the following operation: choose a die and toss it. However, in the second and subsequent operations, if the die shows a number that is less than or equal to the number shown in the previous operation, the process ends. The die to toss each time can be chosen after seeing the previous number shown.

Takahashi wants to toss a die as many times as possible. Find the expected number of operations done when the choices are made to maximize this number.

### Constraints

• 1 \leq N \leq 30000
• 1 \leq A_{i,j} \leq {10}^{9}
• A_{i,j} are all different.
• All values in input are integers.

### Input

Input is given from Standard Input in the following format:

N
A_{1,1} A_{1,2} A_{1,3} A_{1,4} A_{1, 5} A_{1, 6}
A_{2,1} A_{2,2} A_{2,3} A_{2,4} A_{2, 5} A_{2, 6}
:
A_{N,1} A_{N,2} A_{N,3} A_{N,4} A_{N, 5} A_{N, 6}


### Output

Print a real number representing the expected number of operations done. Your output is considered correct if the absolute or relative error from the judge's output is at most 10^{-6}.

### Sample Input 1

2
1 2 3 4 5 6
7 8 9 10 11 12


### Sample Output 1

3.64925355954377