e-olymp
Competitions

WEEK5 GEOMETRY

Point and triangle

Does the point O belongs to the triangle ABC?

Input

Contains the coordinates of the points O, A, B, C. All values are integer, not greater than 100 by absolute value.

Output

Print 1 if the point O belongs to the triangle ABC and 0 otherwise.

Time limit 1 second
Memory limit 128 MiB
Input example #1
1 1 -1 0 2 4 4 1
Output example #1
1