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.

Input

The 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.

Output

A single floating point value that represents the $$$x$$$ coordinate at which the two lines intersect.

ExampleInput
5 3
-6 -20
Output
-2.090909090909091
Note

Assume that all test cases contain lines that do intersect.

加入题单

上一题 下一题 算法标签: