No.456 Millions of Submits!
Problem Statement
Since the dawn of history, competitive programmers have made millions of submissions.
More than 1 million submissions have been made on Atcoder, and it is said that $m$ of them were polynomial-time algorithms.
According to a survey, the program submitted $i$-th,
for a positive input size $n$, takes $n^{a_i} \log^{b_i} n$ seconds of computation time (n is not necessarily an integer; log is the natural logarithm).
It is also known that the $i$-th submission actually took $t_i$ seconds.
Each submission is said to have been solved for an input size n. Among the possible values of n, find the largest n.
Input
m a_1 b_1 t_1 ... a_m b_m t_m
$1 \leq m \leq 1000000$, integer.
$0 \leq a_i, b_i \leq 10$, integers.
For every $i$, at least one of $a_i$ and $b_i$ is not $0$.
$0.1 \leq t_i \leq 10$, given to the 4th decimal place (the 5th and later decimal places are not given).
Output
Output $m$ lines in total. On the $i$-th line, output the largest $n$ among the sizes $n$ that the $i$-th submission was run on.
An error of up to $10^{-9}$ is allowed. Print a newline at the end.
Due to the output size limit, printing more than 12 decimal places may result in OLE (Output Limit Exceed).
It is recommended to output your answers with at most 12 decimal places.
NOTE
Using a fast language is recommended. It has been confirmed that C++ and C# can pass.
Please note that, because of the output size, judging the last case may take a very long time.
Sample
Sample 1
Input
3 2 0 9.0000 1 1 10.0000 0 1 2.0000
Output
3 5.728925565387 7.389056098933
For the 1st line, $n^2 = 9$, so $n=3$.
For the 2nd line, $n \log n = 10$. This has a unique solution at $n \fallingdotseq 5.728925565387$.
For the 3rd line, $\log n = 2$, so $n=e^2 \fallingdotseq 7.389056098933$.
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。
はむこ
りあん