410627: GYM104067 B Кошмар наяву

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

B. Curious Boxtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

You are given a box with an interesting device on its lid, represented as a plane with the following elements:

  1. A circle $$$C$$$ with center at point $$$(x_0, y_0)$$$ and radius $$$r$$$.
  2. A line $$$L$$$ given by equation $$$ax + by + c = 0$$$.
  3. Two marked points with coordinates $$$(x_1, y_1)$$$ and $$$(x_2, y_2)$$$.

You can rotate the circle around its center, and the marked points that are located on it will rotate along with it.

Determine whether it is possible to rotate the circle so that the line $$$L$$$ and the line passing through the marked points are parallel.

Input

The first line contains three space-separated integers $$$x_0$$$, $$$y_0$$$, and $$$r$$$, which represent the coordinates of the center of the circle and its radius ($$$|x_0|, |y_0| \le 10^4$$$; $$$0 \le r \le 10^4$$$).

The second line contains three integers $$$a$$$, $$$b$$$, and $$$c$$$, which are the coefficients of the equation of the line $$$L$$$ ($$$|a|, |b|, |c| \le 10^4$$$).

The third line contains the coordinates of the first marked point $$$x_1$$$ and $$$y_1$$$($$$|x_1|, |y_1| \le 10^4$$$).

The fourth line contains the coordinates of the second point $$$x_2$$$ and $$$y_2$$$ in the same format.

Output

Print "YES" (without quotes) if there is a way to rotate the circle to make lines parallel and "NO" otherwise.

ExamplesInput
0 0 6
1 1 1
0 0
1 1
Output
YES
Input
0 0 6
1 -1 1
0 0
1 1
Output
YES
Input
0 0 6
1 1 0
6 0
10 0
Output
NO

加入题单

上一题 下一题 算法标签: