0116. Area
Input file name: | area.ln |
Output file name: | area.out |
Time limit: | 1 s |
Memory limit: | 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:
area.ln | area.out |
---|---|
3 0 0 1 0 0 1 | 0.5000000000...000 |
Source: Petrozavodsk Summer 2003. Blitz Kontest, Monday, August 25
Author: Andrew Lopatin, Nick Durov
Discuss Submit a solution
Printable version