CF26D.Tickets

提高+/省选-

通过率:0%

时间限制:2.00s

内存限制:256MB

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

As a big fan of Formula One, Charlie is really happy with the fact that he has to organize ticket sells for the next Grand Prix race in his own city. Unfortunately, the finacial crisis is striking everywhere and all the banknotes left in his country are valued either 10 euros or 20 euros. The price of all tickets for the race is 10 euros, so whenever someone comes to the ticket store only with 20 euro banknote Charlie must have a 10 euro banknote to give them change. Charlie realize that with the huge deficit of banknotes this could be a problem. Charlie has some priceless information but couldn't make use of it, so he needs your help. Exactly n + m people will come to buy a ticket. n of them will have only a single 10 euro banknote, and m of them will have only a single 20 euro banknote. Currently Charlie has k 10 euro banknotes, which he can use for change if needed. All n + m people will come to the ticket store in random order, all orders are equiprobable. Return the probability that the ticket selling process will run smoothly, i.e. Charlie will have change for every person with 20 euro banknote.

作为一名一级方程式赛车的狂热粉丝,查理非常高兴自己将负责组织下一场大奖赛在他所在城市的门票销售工作。不幸的是,金融危机席卷 everywhere,他所在国家目前流通的纸币面额仅有 10 欧元和 20 欧元两种。所有赛事门票的售价均为 10 欧元,因此每当有人仅持有一张 20 欧元纸币前来购票时,查理必须拥有一张 10 欧元纸币为其找零。查理意识到,在纸币严重短缺的情况下,这可能成为一个问题。查理掌握了一些极其宝贵的信息,却不知如何利用,因此他需要你的帮助。恰好有 n+mn + m 人将前来购票:其中 nn 人每人仅持有一张 10 欧元纸币,mm 人每人仅持有一张 20 欧元纸币。目前查理手头有 kk 张 10 欧元纸币,可在需要时用于找零。这 n+mn + m 人将以完全随机的顺序依次到达售票处,所有可能的到达顺序等概率出现。请计算整个售票过程能顺利进行(即:对每一位持 20 欧元纸币前来的顾客,查理均能及时提供找零)的概率。

输入格式

The input consist of a single line with three space separated integers, n, m and k (0 ≤ n, m ≤ 105, 0 ≤ k ≤ 10).

输入包含一行,由三个用空格分隔的整数 nn、mm 和 kk 组成(0 ≤ n, m ≤ 1050 \leq n, m \leq 10^5,0 ≤ k ≤ 100 \leq k \leq 10)。

输出格式

Output on a single line the desired probability with at least 4 digits after the decimal point.

在一行中输出所求概率,小数点后至少保留 4 位数字。

输入输出样例

  • 输入#1

    5 3 1

    输出#1

    0.857143
  • 输入#2

    0 5 5

    输出#2

    1
  • 输入#3

    0 1 0

    输出#3

    0

输入解题思路,AI测评打分。不知道怎么写?

首页