1.1 Otto's Homework
(RankList for this Question)
Score: 20pts
Time Limit: 5.00 sec
Otto was solving his Geometry homework. His teacher has given him several pairs of straight line equations in the form of y=mx+c. Otto has to determine if the lines are parallel or not. But as we all know, Otto is lazy and doesn’t do his homework on time so now you have to help him.

1 <= t <= 100
-10 <= m1, m2 <= 10
-100 <= c1, c2 <= 10

Input Format
t (No. of test cases)
For each test case-
m1 c1 m2 c2 (slope of line 1, y-intercept of line 1, slope of line 2, y-intercept of line 2 respectively)

Output Format
For each test case -
- If the lines are parallel, print “Parallel”
- If the lines are intersecting, print x and y coordinates of the intersection point separated by space (Note - output maybe in decimal. Print 5 digits after decimal point)

Example 1
10 3 10 -3
10 3 4 -10
4 69 5 88

-2.16667 -18.66667
-19.00000 -7.00000

In the first test case, the equations of the lines are y=10x+3 and y=10x-3. These lines don’t intersect.

In the second test case, the equations of the lines are y=10x+3 and y=4x-10. These lines intersect at point (-2.16667, -18.66667)

Log In to solve the Question