407094: GYM102697 065 Intersection of Two Lines
Memory Limit:256 MB
Time Limit:1 S
Judge Style:Text Compare
Creator:
Submit:0
Solved:0
Description
065. Intersection of Two Linestime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output
When performing calculations on linear equations, finding the intersection point of two lines is a very common task. Write a program that takes two linear equations in the form of $$$y=mx+b$$$ and outputs the $$$x$$$ coordinate at which the two lines intersect.
InputThe first line contains two floating point values representing the $$$m$$$ and $$$b$$$ values of the first linear equation respectively. The second line contains the two variables corresponding to the $$$m$$$ and $$$b$$$ variables of the second linear equation.
OutputA single floating point value that represents the $$$x$$$ coordinate at which the two lines intersect.
ExampleInput5 3 -6 -20Output
-2.090909090909091Note
Assume that all test cases contain lines that do intersect.