1
Examples
Example 1
Input
3
10 20 30
Output
1.833333
Explanation:
So all possible permutations are:
{10 20 30}
{10 30 20}
{20} {10 30}
{20 30} {10}
{30} {10 20}
{30 20} {10}
So here there are total 6 permutations, and total number of groups are 11.
So, output is 11/6 = 1.833333
Example 2
Input
4
56 78 13 92
Output
2.083333
Explanation:
So here there are total 24 permutations,
For example:
{56 78 13 92}
{92} {13 78 56}
{56} {13 92 78}
{78 92} {13 56}
.
.
So on and so forth. The total number of groups are 50.
So, the output is 50/24 = 2.083333