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

~/algor $ cat problems/shakl-yuzi

Area of a shape

Easy 1000 ms 64 MB 20%
Share

The code of a shape $k$ and its dimensions are given. Find the area of the shape: $k = 1$ — a square with side $a$; $k = 2$ — a rectangle with sides $a$ and $b$; $k = 3$ — a parallelogram with base $a$ and height $h$.

A square, a rectangle and a parallelogram with their dimensions; the shape with the given code highlighted

Input

The first line has an integer $k$.
The second line has one number $a$ if $k = 1$, otherwise two numbers: $a$ and $b$ (or $a$ and $h$).

Output

One integer — the area of the shape.

Note

$k \in \{1, 2, 3\}$
$1 \le a, b, h \le 10^{4}$

Examples

Input #1
2
4 7
Output #1
28
Input #2
1
9
Output #2
81

Sign in to submit a solution

Signing up is free and takes a minute.