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

~/algor $ cat problems/begin-trapetsiya-yuzi

Area of a trapezoid

Easy 1000 ms 64 MB 11%
Share

The bases $a$ and $b$ of a trapezoid and its height $h$ are given. Find its area $S$:

$$S = \frac{(a + b) * h}{2}$$

A trapezoid: bottom base a, top base b, height h

Input

One line with three positive integers: $a$, $b$ and $h$.

Output

One number — $S$, with exactly 1 digit after the decimal point (for example, 8.0).

Note

$1 \le a, b, h \le 10^{4}$

Examples

Input #1
3 5 2
Output #1
8.0
Input #2
1 2 1
Output #2
1.5

Sign in to submit a solution

Signing up is free and takes a minute.