当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

5236:Article

题目描述
As the term is going to end, DRD begins to write his final article.

DRD uses the famous Macrohard's software, World, to write his article. Unfortunately this software is rather unstable, and it always crashes. DRD needs to write $n$ characters in his article. He can press a key to input a character at time $i+0.1$, where $i$ is an integer equal or greater than 0. But at every time $i-0.1$ for integer $i$ strictly greater than 0, World might crash with probability $p$ and DRD loses his work, so he maybe has to restart from his latest saved article. To prevent write it again and again, DRD can press Ctrl-S to save his document at time $i$. Due to the strange keyboard DRD uses, to press Ctrl-S he needs to press $x$ characters. If DRD has input his total article, he has to press Ctrl-S to save the document.

Since World crashes too often, now he is asking his friend ATM for the optimal strategy to input his article. A strategy is measured by its expectation keys DRD needs to press.

Note that DRD can press a key at fast enough speed.
输入解释
First line: an positive integer $0 \leq T \leq 20$ indicating the number of cases.
Next T lines: each line has a positive integer $n \leq 10^5$, a positive real $0.1 \leq p \leq 0.9$, and a positive integer $x \leq 100$.
输出解释
For each test case: output ''Case #k: ans'' (without quotes), where $k$ is the number of the test cases, and $ans$ is the expectation of keys of the optimal strategy.
Your answer is considered correct if and only if the absolute error or the relative error is smaller than $10^{-6}$.
输入样例
2
1 0.5 2
2 0.4 2
输出样例
Case #1: 4.000000
Case #2: 6.444444
来自杭电HDUOJ的附加信息
Recommend

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-5236

最后修改于 2020-10-25T23:20:56+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
2000/1000MS(Java/Others) 32768/32768K(Java/Others)