IIT ASPIRANT

All submissions for this problem are available.
IIT ASPIRANT
Shekhar
Gupta is an IIT aspirant. He has been advised by his teachers to focus on
Coordinate Geometry. He has a manual which contains questions on Coordinate
Geometry. However, solutions and answers for the questions are not available.
Hence, he has no means of verifying the answers.
Currently he’s solving the following
Problem:
“Given equations for two straight lines ax+by+c=0
and lx+my+n=0, find the triple representing the angle
between the lines.”
You need to help Shekhar
by writing a program which produces the TRIPLES for the angle of intersection of the two lines.
Note: Triple is defined by a,b,c where a is base, b is height
and c is hypotenuse of a triangle. Each triple corresponds to an angle given by
cosA= a/c
© Vishal Gupta
Input:
Input contains several test cases.
Each test contains two lines. The first line contains coefficients
for the first line , i.e., a,b,c
similarly the second line contains the coefficients
for the secondline l,m,n. Where a,b,c,l,m,n are integers.
Output:
Output should produce the Triple(Floating points upto
2 decimal places); however if all Triples turn out to be Integers, print the
Prime Triples for the angle of intersection between the two lines.
Sample Input:
4 3 12
1 1 10
1 2 4
2 1 9
Sample Output:
7 1 7.07
0 1 1
Explanation:
For the first set of triples, one
element is Irrational, so we print the Floating value upto
2 decimal places. For the second set of triples, all the Triple Elements comes
out to be rational and hence we output the Prime Triples.
Author:  ganesha 
Tags  ganesha 
Date Added:  28032010 
Time Limit:  1 sec 
Source Limit:  50000 Bytes 
Languages:  C, CPP14, JAVA, PYTH, PYTH 3.5, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, rust, SCALA, swift, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, kotlin, PERL6, TEXT, SCM chicken, CLOJ, COB, FS 
Comments
 Please login at the top to post a comment.
SUCCESSFUL SUBMISSIONS
Fetching successful submissions
HELP
If you are still having problems, see a sample solution here. 