Polygon Area
From AOJ. Shape / Area. Solve the geometry problem "Polygon Area".
Examples
Input: [1,2,3]
Output: 0
Input: [2,3,4]
Output: 0
Hints
Core concept: Shoelace formula (Gauss area). Area = ½|∑(x_i·y_{i+1} - x_{i+1}·y_i)|. Cross product of consecutive edge vectors drives it.
Iterate i from 0 to n-1, accumulate x[i]*y[(i+1)%n] - x[(i+1)%n]*y[i]. Take absolute value, divide by 2. Modulo handles wrap-around closure.
Sign flips if vertices given clockwise vs counter-clockwise — always take abs. Formula works for concave polygons too. Use float or long to avoid overflow.
Polygon Area
**From AOJ.** Shape / Area. Solve the geometry problem "Polygon Area".