~/algor $ cat problems/suvlarni-aralashtirish
Mixing water
Easy
1000 ms
64 MB
11%
$m_{2}$ kg of water at $t_{2}$ degrees is poured into $m_{1}$ kg of water at $t_{1}$ degrees. No heat is lost. Find the temperature $t$ of the mixture:
$$t = \frac{m_{1} * t_{1} + m_{2} * t_{2}}{m_{1} + m_{2}}$$
Input
One line with four integers: $m_{1}$, $t_{1}$, $m_{2}$ and $t_{2}$.
Output
One number — $t$, with exactly 2 digits after the decimal point (for example, 35.71).
Note
$1 \le m_{1}, m_{2} \le 1000$
$0 \le t_{1}, t_{2} \le 100$
Examples
Input #1
2 80 3 20
Output #1
44.00
Input #2
3 70 4 10
Output #2
35.71