QOJ.ac

QOJ

시간 제한: 2 s 메모리 제한: 524288 MB 총점: 100 해킹 가능 ✓

#14036. 地震

통계

小 Vitechka 正在尝试通过《雷神之锤》(Quake)中的一个 Boss。每一分钟,他们中的一人会击杀另一人:Boss 死亡的概率为 $p$ 百分比,Vitechka 死亡的概率为 $100 - p$ 百分比。如果 Vitechka 累计击杀 Boss $n$ 次,他就获胜;如果 Boss 累计击杀 Vitechka $m$ 次,Vitechka 就会失败并开始一局新游戏(在这种情况下,他的获胜计数器将被重置为零)。此外,Vitechka 可以在任何他喜欢的时刻重新开始游戏。重新开始游戏不需要消耗任何时间。假设他以最优的方式行动,求 Vitechka 获胜所需的期望时间(以分钟为单位)。

输入格式

第一行包含三个整数 $n$,$m$ 和 $p$($1 \le n, m \le 10^3$,$0 < p < 100$)。

输出格式

在单行中输出该问题的答案(以分钟为单位)。如果答案大于 $10^9$,则输出数字 $10^9$。你的答案的绝对误差或相对误差不能超过 $10^{-6}$。

样例

输入样例 1

2 2 50

输出样例 1

4.666666666666666

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.