Area of a Polygon
The vertices of a simple polygon are listed in order. Print its area, which is always an integer or half-integer — output with one decimal digit (.0 or .5).
Input: the first line has N; the next N lines have the vertices in order.
Output: the polygon's area with exactly one decimal.
Constraints:
- 3 ≤ N ≤ 104
- |coordinates| ≤ 104
Sample Tests
Input 1
3 0 0 4 0 0 3
Output 1
6.0
Input 2
4 0 0 2 0 2 2 0 2
Output 2
4.0
Discussion (opens after you solve — no spoilers before)
No comments yet.