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

~/algor $ cat problems/kopburchak-yuzi

Area of a polygon

Medium 1000 ms 64 MB 53%
Share

A polygon with $n$ vertices is given on the plane: its vertices $(x_{1}; y_{1}), (x_{2}; y_{2}), \ldots, (x_{n}; y_{n})$ are listed in order (clockwise or counterclockwise). The polygon does not intersect itself. Find its area.

A polygon with the given vertices on the coordinate plane and its area

Input

The first line contains a positive integer $n$. Each of the next $n$ lines contains two integers: $x_{i}$ and $y_{i}$.

Output

One number — the area of the polygon, with exactly $1$ digit after the decimal point (for example, 12.0).

Note

$3 \le n \le 10^{5}$
$-10^{6} \le x_{i}, y_{i} \le 10^{6}$

Examples

Input #1
4
0 0
4 0
4 3
0 3
Output #1
12.0
Input #2
3
0 0
3 0
0 5
Output #2
7.5

Sign in to submit a solution

Signing up is free and takes a minute.