#CCBCMCHIN0000040. Công thức Bhaskara (Bhaskara’s Formula)
Công thức Bhaskara (Bhaskara’s Formula)
Bhaskara’s Formula
Source: beecrowd
Version: Phuoc Hung OJ Extended
Problem Statement
Given real coefficients of , calculate two real roots using the quadratic formula. If or , print the specified failure message. Otherwise compute and .
Input
One line contains real numbers using a decimal point.
Output
If the real roots cannot be computed, print exactly Impossivel calcular. Otherwise print R1 = ... and R2 = ... on separate lines with exactly five digits after the decimal point.
Subtasks
Subtask 1 (20 points): All coefficients have up to two decimal digits and absolute value at most 10. Subtask 2 (30 points): All coefficients have up to two decimal digits and absolute value at most 100. Subtask 3 (50 points): All coefficients have up to two decimal digits and absolute value at most 1000.
Examples
Example 1
Input
1 -3 2
Output
R1 = 2.00000
R2 = 1.00000
Explanation
The discriminant is 1; its square root is 1, yielding roots 2 and 1.
Example 2
Input
1 0 1
Output
Impossivel calcular
Explanation
The discriminant equals -4; no real square root exists.