#BS0000375. Giải phương trình (Equation)
Bài tập thuộc lộ trình
Mục lục đề ⌄
Giải phương trình (Equation)
Equation
Version: Phuoc Hung OJ Extended
PHOJ practice edition. Its constraints, input/output format, examples and judging rules are specified below.
Statement
Given a real number , find the nonnegative solution of $$x^2+\sqrt{x}=C.$$ A unique solution exists in the specified domain.
Input
One line contains a real number with at most 6 decimal places.
Output
Print the root as a real number. Absolute error must not exceed . The output token may contain at most 128 characters; in scientific notation, the explicit exponent must be from -1000 to 1000.
Subtasks
- Subtask 1 (20 points): ; is integral, possibly written with up to 6 decimal places.
- Subtask 2 (30 points): ; at most 6 decimal places.
- Subtask 3 (50 points): ; at most 6 decimal places.
Illustrative examples (not verified as original samples)
Input
2
Output
1.000000000
Explanation
For , take . Its square is and its square root is , giving . Both terms increase on the nonnegative domain, with the square strictly increasing, so there is no other nonnegative solution.
Input
18
Output
4.000000000
Explanation
For , take . Its square is and its square root is , giving . Both terms increase on the nonnegative domain, with the square strictly increasing, so there is no other nonnegative solution.
Input
84
Output
9.000000000
Explanation
For , take . Its square is and its square root is , giving . Both terms increase on the nonnegative domain, with the square strictly increasing, so there is no other nonnegative solution.