No.1064 ∪∩∩ / Cup Cap Cap
Problem Statement
On the $xy$-plane, there are parabolas $C_1:y=x^2+ax+b$ and $C_2:y=-x^2+cx+d$.
If $C_1$ and $C_2$ have $0$ intersection points, output No; if they have $1$, output Yes; if they have $2$, find the equation $y=px+q$ of the line passing through those two points.
Input
$a\ b\ c\ d$
$-10^5 \le a, b, c, d \le 10^5$
All inputs are integers.
Output
If there are $0$ intersection points, output
Noif there is $1$ intersection point, output
Yesand if there are $2$ intersection points, output
$p\ q$(where $p, q$ are the values in $y=px+q$ from the problem statement)
on one line. Print a newline at the end. An error of up to $10^{-6}$ is allowed in the smaller of the absolute error and the relative error.
It is guaranteed that $|p, q| \le 10^{18}$.
Sample
Sample 1
Input
0 0 0 5
Output
0.0000000000 2.5000000000
Sample 2
Input
0 0 0 0
Output
Yes
They intersect only at $(0,0)$.
Sample 3
Input
0 1 0 0
Output
No
They do not intersect.
Sample 4
Input
79716 54835 73742 74932
Output
76729.0000000000 64883.5000000000
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。
null
ui_mtc