|시간 제한||메모리 제한||제출||정답||맞은 사람||정답 비율|
|1 초||128 MB||0||0||0||0.000%|
Byteman decided to spend his vacations in Byte Vegas. During his stay in the capital of gambling, he especially enjoyed the Video-Poker game. It is a game which requires a lot of thinking about the strategy. Byteman would like to win the game as many times as possible, so he asked you to write a program, which will help him achieve this goal.
In order to play Video-Poker, a standard deck of 52 cards (from Two to Ace, four suits) is needed. The game is played by only one player, who has to pay one byte-dollar for a single hand. The player is given five randomly selected cards from the deck. Afterwards, the player is allowed to exchange any number of cards. Cards that are exchanged are turned down and the player gets in return the same number of cards from the deck. At the end of the round, the player is paid a number of byte-dollars, according to the payout table. The payout depends on the set of cards the player has in his or her hand.
Following hands are distinguishable (from the weakest to the strongest):
The player is given a payout for the strongest combination of cards he has (for instance, if he has a Full House, then he also has a pair, but the payout is equal to the value of the Full House from the payout table). If the player does not have any of the cards' configurations listed above, he is not paid at all.
Byteman would like to know what is the optimal strategy (which maximizes the expected payout) for different casinos (different casinos may use different payout tables). Prove Byteman that you can calculate this strategy! Given a payout table, calculate for how many hands playing the optimal strategy one would keep all cards, for how many of them you will turn down one, two, three, four and finally five cards. If many different moves end with the same expected payout, it is required to select the move, which requires keeping the least number of cards.
Byteman gave you some payout tables from different casinos. Your task is to calculate required results for all of them. Your program can simply output precomputed values.
Write a program which:
The first and only line of the standard input defines the payout table. It contains nine positive integers, separated by single spaces. They represent payouts for a Pair, Two pairs, Three of a kind, Straight, Flush, Full House, Four of a kind, Straight Flush and Royal Flush. Your program will be tested with the following sets of input data:
1 2 3 4 6 9 25 50 940
1 2 3 4 5 9 25 50 800
1 2 3 4 6 8 25 50 800
1 2 3 4 5 8 25 50 800
1 2 3 4 5 7 25 50 800
1 2 3 4 5 6 25 50 800
1 2 2 4 6 9 30 125 1000
1 2 2 4 6 9 30 100 1000
1 2 3 4 5 6 25 50 1000
1 2 2 4 6 9 30 100 500
In the first line of the standard output there should be 6 integers, separated by single spaces. They represent the number of hands, for which the optimal strategy requires turning down 0, 1, 2, 3, 4 and 5 cards.
1 2 3 4 6 9 25 50 800
18864 292800 147528 1651440 403968 84360