QOJ.ac

QOJ

Time Limit: 1 s Memory Limit: 512 MB Total points: 100

#4003. 舍入大师

Statistics

Grammy 获得了舍入硕士学位(她自己授予的)。她可以使用她的舍入技术,通过改变单位和舍入来获得一个超大的数字。

特别地,她有一个初始值为 $1$ 的数字 $x$。她将执行 $k$ 次以下操作,并最终使她的数字 $x \ge n$。在每次操作中,她将 $x$ 乘以 $q$ ($q > 0$),然后对其进行舍入。对数字 $w$ 进行舍入意味着找到整数 $a$,使得 $a \le w < a + 1$,如果 $w \ge a + 0.5$,则将 $w$ 变为 $a + 1$,否则将 $w$ 变为 $a$。

你能帮她选择最小的 $q$,使得经过 $k$ 次操作后,$x$ 大于或等于 $n$ 吗?

输入格式

第一行包含两个整数 $n, k$ ($1 \le n, k \le 10^{18}$),分别表示最终目标和操作次数。

输出格式

输出一个正实数 $q$,表示答案。如果你的答案的绝对误差或相对误差不超过 $10^{-6}$,则被视为正确。

样例

输入格式 1

18 4

输出格式 1

2.125000000000

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.