Skip to main content
Tuesday (24.11.2026) at 20:00: ALGOR Contest: Round #4 (Special Challenge) starts!

~/algor $ cat problems/begin-rezistorlar

Connecting resistors

Easy 1000 ms 64 MB 11%
Share

There are two resistors with resistances $R_{1}$ and $R_{2}$ (ohms). Connected in series, their total resistance is $R_{k}$; connected in parallel, it is $R_{p}$. Find both:

$$R_{k} = R_{1} + R_{2}, \qquad R_{p} = \frac{R_{1} * R_{2}}{R_{1} + R_{2}}$$

Top: two resistors in series (total resistance Rk); bottom: in parallel (total resistance Rp)

Input

One line with two positive integers: $R_{1}$ and $R_{2}$.

Output

One line with two numbers: $R_{k}$ — an integer, $R_{p}$ — with exactly 2 digits after the decimal point (for example, 1.20).

Note

$1 \le R_{1}, R_{2} \le 10^{4}$

Examples

Input #1
2 3
Output #1
5 1.20
Input #2
10 10
Output #2
20 5.00

Sign in to submit a solution

Signing up is free and takes a minute.