Intersection of two lines
Easy
Execution time limit is 1 second
Runtime memory usage limit is 128 megabytes
Find the intersection point of two lines. Each line is given with the pair of points on it.
Input
Two lines are given. Each line contains four integers, not greater than 100 by absolute value - the coordinates of the points specifying the lines.
Output
Print in the first line 0 if lines do not intersect, print 1 if lines intersect in one point and print 2 if lines coincide. If the lines intersect each other and do not coincide, print in the second line the coordinates of intersection point with 7 digits after the decimal point.
Examples
Input #1
Answer #1
Submissions 3K
Acceptance rate 13%