問題一覧 > 通常問題

No.1042 Brute Force University

レベル : / AI推定難易度 : 600 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 小数誤差許容問題 絶対誤差または相対誤差が $10^{-5}$ 以下。ただし、ジャッジ側の都合で500桁未満にしてください
タグ : (AC するまで非表示) / 解いたユーザー数 333
作問者 : Suunn / テスター : asdf1
お気に入りにしたユーザー ProblemId : 3619 / 自分の提出
問題文最終更新日: 2020-05-03 18:22:21
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
yukicoder contest 246 (順位表) の他の問題:

Problem Statement

Takahashi is a student at Brute Force University (abbreviated: Chokudai).

Meanwhile, his rival Hikuhashi is a student at Speedup University (abbreviated: Sokudai). One day, the two decided to compete to see who could solve a problem faster.

The size of a problem is denoted by $N$. Since Takahashi is a student at Brute Force University, he starts computing by brute force and takes $N^2$ seconds to finish solving the problem. On the other hand, since Hikuhashi is a student at Speedup University, $P$ seconds after seeing the problem he notices that the algorithm called binary search can be used on it, and it then takes him a further $Q*N*log_2 N$ seconds from actually starting to solve the problem until he finishes.

Takahashi wants to beat Hikuhashi, so find the largest $N$ in the range where Takahashi does not finish solving the problem later than Hikuhashi. It is guaranteed that Takahashi can beat Hikuhashi when $N=1$.

(Note): $N$ does not have to be an integer. Also, an error of up to $10^{-5}$ is allowed in the output.

(Added 2020/5/3: Under the constraints, it can be proved that Takahashi does not lose to Hikuhashi when the problem size is at least 1 and at most the N to be found.)

Input

$P\ Q$

$2 \le P \le 10^9$
$1 \le Q \le 10^9$
$P,Q$ are integers.

Output

Find the maximum problem size for which Takahashi does not lose. An absolute or relative error of up to $10^{-5}$ is allowed in the output.

Sample

Sample 1
Input
8 1
Output
4.000000000

When $N=4$, Takahashi and Hikuhashi finish solving the problem at the same time.

Sample 2
Input
7654321 1234567
Output
30706182.561749045

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。