题库练习 Cow Camp--Gold
← 上一题 下一题 →

A857 | Cow Camp--Gold

来源USACO
时间限制1s
内存限制128MB
通过 / 提交0/0

题目描述

To qualify for cow camp, Bessie needs to earn a good score on the last problem
of the USACOW Open contest. This problem has $T$ distinct test cases ($2\le
T\le 10^3$) weighted equally, with the first test case being the sample case.
Her final score will equal the number of test cases that her last submission
passes.
Unfortunately, Bessie is way too tired to think about the problem, but since
the answer to each test case is either "yes" or "no," she has a plan!
Precisely, she decides to repeatedly submit the following nondeterministic
solution:
if input == sample_input:
print sample_output
else:
print "yes" or "no" each with probability 1/2, independently for each test case
Note that for all test cases besides the sample, this program may produce a
different output when resubmitted, so the number of test cases that it passes
will vary.
Bessie knows that she cannot submit more than $K$ ($1\le K\le 10^9$) times in
total because then she will certainly be disqualified. What is the maximum
possible expected value of Bessie's final score, assuming that she follows the
optimal strategy?

输入格式

The only line of input contains two space-separated integers $T$ and $K.$

输出格式

The answer as a decimal that differs by at most $10^{-6}$ absolute or relative
error from the actual answer.

输入输出样例

输入 #1
2 3
输出 #1
1.875
C++ 编辑器
输入
输出