The Area of the Polygon
The coordinates of n consecutive points of polygon are given. Find the area of the polygon.
Specifications
Input
The number of polygon vertices n is given in the first line. In next n lines the coordinates of consecutive vertices xi, yi are given. It is known that 3 ≤ n ≤ 1000, -1000 ≤ xi, yi ≤ 1000.
Output
The area of the polygon with 3 digits after the decimal point.
Problem information
Time Limit: 1 secondsMemory Limit: 64 MB
Balls for the passed test: 10
Complexity: 18% 403/489
Classes: Geometry
Example
Example input3 0 0 0 2 2 0 |
Example output2.000 |
| ← The Cells are Painted out | Problems | Cleaning up the Snow → |
