14684 - Determine if line segments can form a triangle   

Description

Write a program to determine if three line segments can form a triangle.
You may translate the line segments, but you cannot rotate or flip them.
It is guaranteed that all line segments have different slopes, so you do not need to worry about zero-area triangles.

The input contains 12 integers. Each group of 4 integers represents the x,y coordinates of the start and end points of one line segment.

If the three line segments can form a triangle, output 1; otherwise, output 0.

(Hint: Recall the the vector components 向量分量)

Input

12 integers, representing the coordinates of the three line segments.

Each group of 4 integers represents the x,y coordinates of the start and end points of one line segment. i.e. (x_start y_start x_end y_end)

Output

One integer: 1 if the segments can form a triangle, otherwise 0.

Ensure that the output, including formatting, exactly matches the provided samples.

Sample Input  Download

Sample Output  Download

Tags

11410EE 231002



Discuss