Point of intersection of straight lines
Two straight lines are given on the plane. Each straight line is defined by a pair of points through which it passes. It is required to determine whether these lines intersect and find the coordinates of the intersection point.
The coordinates of two different points through which the first straight line passes are entered first, and then the coordinates of two more different (but perhaps coinciding with the first two) points through which the second straight line passes. The coordinates of each point are integers, modulo no more than 1000.
If the lines do not intersect, print one number 0. If the lines match, output 2. If the lines intersect at exactly one point, then print first the number 1, and then two real numbers - the coordinates of the intersection point with six correct signs after the point.
0 0 1 1 1 0 -1 2
1 5.0000000E-0001 5.000000E-0001