QOJ.ac

QOJ

Limite de temps : 3.0 s Limite de mémoire : 512 MB Points totaux : 100

#12702. 奖励卡片

Statistiques

Dmitry 非常热爱程序设计竞赛。著名的冠军联赛决赛即将在 Dmitry 的家乡举行,因此他非常想去现场观看比赛。这场比赛非常受欢迎,但大部分门票都预留给了 VIP 和赞助商。

对于公众,冠军联赛决赛的门票通过以下方式分配:想要观看比赛的观众提交他们的申请,并注明他们希望使用的支付方式。假设共有 $n$ 个座位可供分配。比赛将进行多轮抽奖。在每一轮中,每个尚未满足的申请根据其支付方式获得一定数量的抽奖槽位。然后,从这些槽位中随机均匀地抽取一个。该槽位所属的申请被视为已满足,并不再参与后续的抽奖轮次。抽奖在 $n$ 轮结束后,或者当没有更多未满足的申请时停止,以先到者为准。国际卡处理公司(ICPC)是冠军联赛的赞助商。选择 ICPC 卡作为支付方式的观众在每一轮抽奖中获得两个槽位,而使用其他支付方式的用户仅获得一个。

Dmitry 持有一张 ICPC 卡,但他同时也持有一张 Advanced Credit Merchandise (ACM) 卡,该卡在他所有的消费中提供奖励。他的兄弟 Petr 在负责分发门票的抽奖公司工作,因此他提前告诉了 Dmitry 已经有多少人决定使用 ICPC 卡,以及有多少人决定使用其他支付方式。现在,Dmitry 想知道如果他使用 ICPC 卡或使用 ACM 卡,他获得门票的概率分别是多少,以便他能做出明智的选择。他的申请是在 Petr 告诉他的申请人数之外额外增加的。

你能帮帮他吗?

输入格式

输入的第一行也是唯一一行包含 3 个整数:可供抽奖的座位数 $n$ ($1 \le n \le 3000$),使用 ICPC 卡支付的申请人数 $a$,以及使用其他支付方式的申请人数 $b$ ($0 \le a, b \le 10^9$)。

输出格式

第一行输出使用 ICPC 卡获得门票的概率。第二行输出使用 ACM 卡获得门票的概率。答案的绝对误差不能超过 $10^{-9}$。

样例

样例输入 1

1 1 2

样例输出 1

0.3333333333333333
0.2

样例输入 2

10 10 10

样例输出 2

0.5870875690480144
0.3640355515319861

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.