P6708 [CCC 2020] Josh's Double Bacon Deluxe

Background

Josh and $N-1$ other people go to eat burgers.

Description

This burger shop has $M$ types of burgers. Person $i$ likes burger type $b_i$ the most. All $N$ people will choose their favorite burger. Now, these $N$ people line up to pick up burgers. Unfortunately, the first person forgets his favorite burger, so he takes a random burger. The next $N-2$ people will take burgers according to the following rules: - If his favorite burger is available, he takes it directly. - Otherwise, he takes a random one. You need to find the probability that Josh, who is **last in line**, gets his favorite burger.

Input Format

The first line contains an integer $N$. The next $N$ lines each contain an integer $b_i$.

Output Format

Output one decimal number, representing the probability that Josh, who is **last in line**, gets his favorite burger.

Explanation/Hint

#### Explanation for Sample 1 | The first person's choice | The second person's choice | Josh's choice | Probability | | :----------: | :----------: | :----------: | :----------: | | $1$ | $2$ | $3$ | $\frac{1}{3}$ | | $2$ | $1$ | $3$ | $\frac{1}{3}\times \frac{1}{2}=\frac{1}{6}$ | | $2$ | $3$ | $1$ | $\frac{1}{6}$ | | $3$ | $2$ | $1$ | $\frac{1}{3}$ | The probability that Josh gets his favorite burger is $\frac{1}{3}+\frac{1}{6}=\frac{1}{2}$. #### SPJ Scoring Let the correct answer be $C$, and your answer be $P$. If $\lvert P-C\rvert