Triangle and point
Very easy
Execution time limit is 1 second
Runtime memory usage limit is 128 megabytes
The triangle and the point are given on the 2D coordinate plane. Is the point In, On or Out of the triangle?
Input
The coordinates of the vertices of a triangle are given in the first 3 lines (each line contains 2 integers). The fourth line contains the point's coordinates in the same format. All numbers are integers; their absolute values are no more than 10000. The vertices of triangle do not lie on a straight line.
Output
Print the word "In" if the point is located inside the triangle, "On" if the point lies on the border of triangle (on the vertex or on the edge), and "Out" if the point is outside the triangle.
Examples
Input #1
Answer #1
Submissions 10K
Acceptance rate 21%