Consider the following game. There is a deck, which consists of cards of $$$n$$$ different suits. For each suit, there are $$$13$$$ cards in the deck, all with different ranks (the ranks are $$$2$$$, $$$3$$$, $$$4$$$, ..., $$$10$$$, Jack, Queen, King and Ace).
Initially, the deck is shuffled randomly (all $$$(13n)!$$$ possible orders of cards have the same probability). You draw $$$5$$$ topmost cards from the deck. Then, every turn of the game, the following events happen, in the given order:
Your goal is to find a strategy that allows you to win in the minimum expected number of turns. Note that the turn when the game ends is not counted (for example, if the $$$5$$$ cards you draw initially already form a Royal Flush, you win in $$$0$$$ turns).
Calculate the minimum possible expected number of turns required to win the game.
The only line contains one integer $$$n$$$ ($$$1 \le n \le 4$$$) — the number of suits used in the game.
Print the minimum expected number of turns.
Your answer will be considered correct if its absolute or relative error does not exceed $$$10^{-6}$$$. Formally, let your answer be $$$a$$$, and the jury's answer be $$$b$$$. Your answer will be accepted if and only if $$$\frac{|a - b|}{\max{(1, |b|)}} \le 10^{-6}$$$.
1
3.598290598
2
8.067171309
Название |
---|