Module: Geometry


Problem

3 /7


Lazy Vasya and the release of Half-Life 3

Theory Click to read/hide

The line can be defined in 5 different ways:
1) equation \( y = kx + b\); the very first equation of a straight line that is taught in school is convenient for building and calculating manually, but its use in a program is very inconvenient;
2) by 2 points lying on it - actually quite convenient, but has a rather narrow application;
3) by the normal vector of a straight line and a point - the normal vector to a straight line is a vector perpendicular to it, more about it below;
4) along the directing vector of the straight line and the point - the directing vector is a vector lying on the straight line and perpendicular to the normal vector (well, logical), about it below;
5) equation of a straight line \(ax + by + c = 0\); the classical equation of a straight line, in most cases the most universal. Now about him.

Coordinates of the normal vector of such a line: \((a; b)\) or \( (-a; -b)\).

Coordinates of the direction vector of such a line: \((-b; a)\) or \ ((b; -a)\).

Lines are parallel if:
\({a1 \over b1} = {a2 \over b2}\).

Distance from a point to a line (be careful: the distance can be negative, it all depends on which side of the line the point lies):
\({(a \cdot x_1 + b \cdot y_1 + c) \over \sqrt{a^2 + b^2}}\),
where x1, y1 are the coordinates of the point.

Constructing a line from a normal vector and a point, or a direction vector and a point, comes down to building a line from 2 points, so let's look at it (it is also the most commonly used).< /p>

If x1, y1, x 2, y2 - coordinates of the first and second points respectively, then

\(a = y_1 - y_2\)

\(b = x_2 - x_1\)

\(c = x_1 \cdot y_2 - x_2 \cdot y_1\)

Problem

A miracle happened! The long-awaited Half-Life 3, which millions of people around the world dreamed of, is finally out! Vasya was also looking forward to the continuation of the legendary series, and did not even eat in the school cafeteria for a whole month, so that he would have enough to buy this masterpiece! The only problem that stands in his way is a huge algebra homework assignment. In class, he went through a new topic - straight lines, and now he needs to do as many as N tasks on building a straight line through 2 points. But you really want to play, and the next day tell your friends what a cool graphic there is ... Therefore, he asked you, his friend, to help him.
 
Input
The first line contains the coordinates of the first point (X1, Y1), (\(-50 <= X_1, Y_1 <= 50\)).
The second line contains the coordinates of the second point (X2, Y2), (\(-50 <= X_2, Y_2 <= 50\)).
 
Output
On a single line print 3 integers in a row: the coefficients a, b, c of the equation of a straight line.
 
Note: if your task doesn't work, but you are sure that everything is correct, try multiplying all coefficients by -1. The task assumes that you have used formulas taken from the lecture/theory.

 

Examples
# Input Output
1
-1 -1
1 1
-2 2 0