407042: GYM102697 013 Resistors in Parallel
Memory Limit:256 MB
Time Limit:1 S
Judge Style:Text Compare
Creator:
Submit:0
Solved:0
Description
013. Resistors in Paralleltime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output
When two resistors with resistances a and b are parallel in an electronic circuit, their equivalent resistance is calculated as (a * b) / (a + b). Given the resistances of two resistors, calculate their equivalent resistance.
InputThe first line of input contains a single positive integer a: the resistance of the first resistor. The second line of input contains a single positive integer b: the resistance of the second resistor.
OutputOutput a single positive decimal number r: the equivalent resistance of the two resistors, calculated using the above formula.
ExamplesInput60 40Output
24.0Input
80 70Output
37.333333333333336