No.242 Bingo Game
タグ : / 解いたユーザー数 113
作問者 :
nmnmnmnmnmnmnm
Problem Statement
We play a bingo game using a card with a grid of $5\times5$ squares.
The $25$ squares of the card contain $25$ of the numbers from $1$ to $99$, written without duplicates.
When $5$ numbers line up in $1$ line, either vertically, horizontally, or diagonally, it counts as $1$ bingo.
A-kun has been handed a bingo card with randomly written numbers.
From now on, $N$ of the numbers from $1$ to $99$ will be called out randomly without duplicates.
What is the expected number of bingos formed after the $N$ numbers have been called out?
Input
$N$
The number $N$ of numbers to be called out is given. $N$ is an integer. $1 \le N \le 99$.
Output
Output the expected number of bingos formed on $1$ line.
The allowed error is $1e-06$.
Do not forget the newline at the end.
Sample
Sample 1
Input
4
Output
0
If only $4$ numbers are called out, not even $1$ bingo can be formed.
Sample 2
Input
62
Output
1.0856908639251
When $62$ numbers are called out, the expected value finally exceeds $1$.
Sample 3
Input
99
Output
12
If all the numbers are called out, all the vertical, horizontal, and diagonal lines should be bingos.
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。