Skip to main content
Tuesday (24.11.2026) at 20:00: ALGOR Contest: Round #4 (Special Challenge) starts!

~/algor $ cat problems/boolean-bir-chiziqdami

On one line?

Easy 1000 ms 64 MB 19%
Share

Three different points $(x_{1}; y_{1})$, $(x_{2}; y_{2})$ and $(x_{3}; y_{3})$ are given on the plane. Check whether the statement is true: “all three points lie on one straight line”. This condition is checked by the equality:

$$(x_{2} - x_{1}) * (y_{3} - y_{1}) = (y_{2} - y_{1}) * (x_{3} - x_{1})$$

Three points lying on one straight line

Input

One line with six integers: $x_{1}$, $y_{1}$, $x_{2}$, $y_{2}$, $x_{3}$ and $y_{3}$.

Output

One integer: $1$ if the statement is true, otherwise $0$.

Note

$-1000 \le x_{1}, y_{1}, x_{2}, y_{2}, x_{3}, y_{3} \le 1000$
The points are different.

Examples

Input #1
0 0 1 1 3 3
Output #1
1
Input #2
0 0 1 2 3 3
Output #2
0

Sign in to submit a solution

Signing up is free and takes a minute.