Line Segment Intersection Problem

You are trying to create a program that calculates the unique intersection point of two line segments, or determines that there isn't one.  You're trying to do this with the minimum number of IF or IF-like decision statements.  Please do NOT make it hard for me to count those in the code, namely do not try to hide them, put them into math functions (like abs()), or use special language constructs which are equivalent to them.  And especially, do not game this problem.

In each trial, you will be given the coordinates of the endpoints of 2 line segments, and must determine whether a) there is a unique point of intersection, or b) there is none, or more than one.  In case of a), output the trial number, followed by "1" and then by the coordinates of the intersection point.  In case of b), output the trial number followed by "0 0 0".  Precision should be at most 2 significant digits. If you cannot determine the answer for a particular trial (e.g. your program crashes on that trial) leave that trial out of the output file.

The input file will consist of a first line indicating the number of trials, followed by that number of trial-lines.  Each trial line consists of the trial number, followed by 4 pairs of point-coordinates  -- the first 2 pairs are endpoints of the first line segment, and the second 2 pairs are the endpoints of the second line segment.  For instance:

2
1 x1 y1 x2 y2 x3 y3 x4 y4
2 x1 y1 x2 y2 x3 y3 x4 y4

The output file should look like this (the first trial had an intersection point at (1.2 3.7), and the second trial did not).:

1 1 1.2 3.7
2 0 0 0

Your program should consist of input-file reading and writing functions at the beginning of the code, followed by a function called Intersection(...) which takes all the point coordinates are arguments (in some form or another), and does the work.  Any helper functions for the Intersection() should be placed below so that I can count the number of IF (or other decision statements) for all code starting with the Intersection function.