200850: [AtCoder]ARC085 C - HSI

Memory Limit:256 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

Score : $300$ points

Problem Statement

Takahashi is now competing in a programming contest, but he received TLE in a problem where the answer is YES or NO.

When he checked the detailed status of the submission, there were $N$ test cases in the problem, and the code received TLE in $M$ of those cases.

Then, he rewrote the code to correctly solve each of those $M$ cases with $1/2$ probability in $1900$ milliseconds, and correctly solve each of the other $N-M$ cases without fail in $100$ milliseconds.

Now, he goes through the following process:

  • Submit the code.
  • Wait until the code finishes execution on all the cases.
  • If the code fails to correctly solve some of the $M$ cases, submit it again.
  • Repeat until the code correctly solve all the cases in one submission.

Let the expected value of the total execution time of the code be $X$ milliseconds. Print $X$ (as an integer).

Constraints

  • All input values are integers.
  • $1 \leq N \leq 100$
  • $1 \leq M \leq {\rm min}(N, 5)$

Input

Input is given from Standard Input in the following format:

$N$ $M$

Output

Print $X$, the expected value of the total execution time of the code, as an integer. It can be proved that, under the constraints in this problem, $X$ is an integer not exceeding $10^9$.


Sample Input 1

1 1

Sample Output 1

3800

In this input, there is only one case. Takahashi will repeatedly submit the code that correctly solves this case with $1/2$ probability in $1900$ milliseconds.

The code will succeed in one attempt with $1/2$ probability, in two attempts with $1/4$ probability, and in three attempts with $1/8$ probability, and so on.

Thus, the answer is $1900 \times 1/2 + (2 \times 1900) \times 1/4 + (3 \times 1900) \times 1/8 + ... = 3800$.


Sample Input 2

10 2

Sample Output 2

18400

The code will take $1900$ milliseconds in each of the $2$ cases, and $100$ milliseconds in each of the $10-2=8$ cases. The probability of the code correctly solving all the cases is $1/2 \times 1/2 = 1/4$.


Sample Input 3

100 5

Sample Output 3

608000

Input

题意翻译

高桥君在参加一场编程竞赛,在一道题中,他TLE了,且这道题的输出是Yes或No。 查看了提交的详细信息后,发现每次都有$n$个测试点,其中有$m$个TLE了。 因此,高桥君在$1900$毫秒内,以二分之一的正确率AC那$m$个TLE的点,然后用剩下的$100$毫秒AC剩下的$n-m$个点。 操作顺序如下: - 提交自己的代码。 - 等待评测机出结果。 - 如果$m$个点没有全部AC,就再交一次。 - 直到全部AC为止。 求操作结束后,总时间$X$的期望值。

加入题单

上一题 下一题 算法标签: