Point and triangle
Very easy
Execution time limit is 1 second
Runtime memory usage limit is 128 megabytes
Does the point O belongs to the triangle ABC? The point belongs to the triangle if it lies inside it or on its boundary.
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.
Examples
Input #1
Answer #1
Input #5
Answer #5
Submissions 15K
Acceptance rate 31%