All submissions for this problem are available.
Gupta is an IIT aspirant. He has been advised by his teachers to focus on
Co-ordinate Geometry. He has a manual which contains questions on Co-ordinate
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
“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
© Vishal Gupta
Input contains several test cases.
Each test contains two lines. The first line contains co-efficients
for the first line , i.e., a,b,c
similarly the second line contains the co-efficients
for the second-line l,m,n. Where a,b,c,l,m,n are integers.
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.
4 -3 -12
1 -1 10
1 2 4
2 -1 9
7 1 7.07
0 1 1
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.
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, 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, PYP3, CLOJ, COB, FS|
Fetching successful submissions
If you are still having problems, see a sample solution here.