0116. Area

Имя входного файла: area.ln
Имя выходного файла: area.out
Ограничение по времени: 1 s
Ограничение по памяти: 64 megabytes

Calculate the area of a polygon.

Input file

First line contains integer number n (3 ≤ n ≤ 50000) – number of vertices. n lines follow, containing two integer numbers x and y each (-10000 ≤ x,y ≤ 10000) – coordinates of vertices.

The vertices indeed form a polygon, i.e. the edges neither cross, nor touch each other.

Vertices are given in counterclockwise order.

Output file

Output the area of the polygon with six hundred digits after decimal point.

Examples:

Output file contains six hundred zeroes.
area.lnarea.out
3 0 0 1 0 0 10.5000000000...000


Источник: Petrozavodsk Summer 2003. Blitz Kontest, Monday, August 25
Автор: Andrew Lopatin, Nick Durov

Обсудить       Отправить решение



Версия для печати