| October come back. Together training |
|---|
| Finished |
Two ants live at points $$$a_1$$$ and $$$a_2$$$ of the coordinate axis. At the same time and at a constant speed, they begin to run in a certain direction. The first ant knows that after $$$t_1$$$ seconds he will be at the point $$$p_1$$$. The second one knows that in $$$t_2$$$ seconds he will be at the point $$$p_2$$$. Determine if the ants will ever meet at the same point. If so, how soon will they meet?
The first line contains 3 integers $$$a_1$$$, $$$t_1$$$, $$$p_1$$$, $$$(-10^4 \leq a_1 \leq 10^4,$$$ $$$1 \leq t_1 \leq 10^4,$$$ $$$-10^4 \leq p_1 \leq 10^4,$$$ $$$a_1 \neq p_1)$$$. The second line contains 3 integers $$$a_2$$$, $$$t_2$$$, $$$p_2$$$, $$$(-10^4 \leq a_2 \leq 10^4,$$$ $$$1 \leq t_2 \leq 10^4,$$$ $$$-10^4 \leq p_2 \leq 10^4,$$$ $$$a_2 \neq p_2)$$$. Also $$$a_1 \neq a_2$$$.
Print -1 if the ants never meet. Otherwise, print a single number - the time until the meeting. It must differ from the correct answer by no more than $$$10^{-6}$$$.
-3 2 5 12 1 10
2.50000000
| Name |
|---|


