luogu#P6997. [NEERC2013] Bonus Cards
[NEERC2013] Bonus Cards
题目描述
Dmitry loves programming competitions very much. The Finals of the famed Champions League are taking place in Dmitry's home city, so he wants to visit the competition. The competition is very popular, but most tickets to the competition are reserved for VIPs and for sponsors.
For the general public tickets to the Champions League Finals are distributed in the following way. Spectators, that want to see the competition, submit their request that states the payment method they want to use to pay for their ticket. Suppose there are seats available. Several draw round are conducted. In each round every request that is not yet fulfilled receives some number of slots depending on the payment method. Then one of those slots is selected uniformly at random. The request to which this slot belongs is considered fulfilled and does not take part in subsequent drawing rounds. Draw ends after rounds or when there are no more unfulfilled requests, whichever occurs first. An International Card Processing Corporation (ICPC) is a sponsor of the Champions League. Those who chose ICPC card as a payment method receive two slots in each draw round, while users of other payment methods receive only one.
Dmitry has a card from ICPC, but he also has a card from Advanced Credit Merchandise which offers him a bonus on all his spendings. His brother Petr works in a company that conducts draw to distribute tickets, so he told Dmitry in advance how many people had already decided to use ICPC card and how many had decided to use other methods. Now Dmitry want to know the probabilities he would get a ticket if he would use his ICPC card or if he would use his ACM card, so that he can make an informed choice. His request is going to be in addition to the number of requests Petr had told him about.
Can you help?
输入格式
The first and the only line of the input contains integer numbers -- the number of seats available for a draw , the number of requests with ICPC card as a payment method a , and the number of requests with other payment methods a ,
输出格式
On the first line output the probability of getting a ticket using ICPC card. On the second line output the probability of getting a ticket using ACM card. Answers should have an absolute error of no more than
题目大意
一个比赛有 张比赛门票,门票用随机抽选的方式决定。有 个人参与一类抽选, 个人参与二类抽选,其中一类抽选选中的概率是二类抽选的两倍。共进行 次抽选,第 次随机抽选在前 次没有选出的名额中选出一个人。也就是说,这个人获得了比赛门票,接下来第 到 次的抽选集合不包括他。
Dmitry 现在如果要参加门票抽选,请你求出他分别参与一类抽选名额和二类抽选名额时,能够获得比赛门票的概率。( 个人不包括 Dmitry)
1 1 2
0.3333333333333333
0.2
10 10 10
0.5870875690480144
0.3640355515319861
提示
Time limit: 1 s, Memory limit: 128 MB.