No.3359 Approximation of the Bring Radical to 3 Decimal Places
Problem Statement
You are given a non-negative integer $C$.
Find the approximation to $3$ decimal places of the non-negative real number $X$ satisfying the equation $X^5 + X - C = 0$.
Here, the approximation to $3$ decimal places of a real number $x$ means the largest real number that has a decimal representation with up to $3$ decimal places and does not exceed $x$.
It can be proved that the non-negative real number $X$ satisfying $X^5 + X - C = 0$ exists uniquely.
Background
By the Abel–Ruffini theorem, it is known that quintic equations have no general solution formula (an explicit formula using only the four arithmetic operations and radicals), but there is a large body of research on expressing the solutions of quintic equations explicitly using (multivalued) functions other than the four arithmetic operations and radicals.
The quintic equation $X^5 + X - C = 0$ treated in this problem is one of the quintic equations in Bring–Jerrard normal form, and every Bring–Jerrard normal form reduces to this form if the constraint that $C$ is a non-negative integer is removed. The solutions of this quintic equation $X^5 + X - C = 0$ (or $X^5 + X + C = 0$) are called the Bring radicals of $C$, and they give a (complex multivalued) function different from radicals.
Input
The input is given from standard input in $1$ line in the following format:
- Line $1$ contains $C$.
$C$
Constraints
The input satisfies the following constraints:
- $C$ is an integer satisfying $0 \leq C < 10^3$.
Output
Print in $1$ line the approximation to $3$ decimal places of the non-negative real number $X$ satisfying $X^5 + X - C = 0$, as an unsigned decimal representation with exactly $3$ digits after the decimal point.
Note that this problem does not allow for floating-point error tolerance.
Print a newline at the end.
Sample
Sample 1
Input
0
Output
0.000
We have $X = 0$, and the approximation to $3$ decimal places of $X$ is $0$. Therefore, print 0.000, the unsigned decimal representation of $0$ with exactly $3$ digits after the decimal point.
Sample 2
Input
1
Output
0.754
We have $X = 0.754 \cdots$, and the approximation to $3$ decimal places of $X$ is $0.754$. Therefore, print 0.754, the unsigned decimal representation of $0.754$ with exactly $3$ digits after the decimal point.
Sample 3
Input
2
Output
1.000
We have $X = 1$, and the approximation to $3$ decimal places of $X$ is $1$. Therefore, print 1.000, the unsigned decimal representation of $1$ with exactly $3$ digits after the decimal point.
Note that since $0.999 \neq 1$, 0.999 is not the unsigned decimal representation of $1$ with exactly $3$ digits after the decimal point.
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。
hamamu