This problem is a programming version of Problem 102 from projecteuler.net
Three distinct points are plotted at random on a Cartesian plane, for which , such that a triangle is formed.
Consider the following two triangles:
It can be verified that triangle ABC contains the origin, whereas triangle XYZ does not.
You are given co-ordinates of N "random" triangles, find the number of triangles for which the interior contains the origin.
First line contains an integer i.e. number of triangles, followed by lines each having 6 space separated integers representing a triangle.
Print 1 line, the number of triangles that contain origin.
-1 -2 1 -2 1 3
-2 -1 -2 1 -1 2