- Prepare
- Functional Programming
- Introduction
- Compute the Area of a Polygon

# Compute the Area of a Polygon

# Compute the Area of a Polygon

You are given the cartesian coordinates of a set of points in a plane. When traversed sequentially, these points form a Polygon, , which is not self-intersecting in nature. Can you compute the area of polygon ?

**Input Format**

The first line contains an integer, , denoting the number of points.

The subsequent lines each contain space-separated integers denoting the respective and coordinates of a point.

**Constraints**

- No points are
*coincident*, and polygon is obtained by traversing the points in a counter-clockwise direction.

**Output Format**

For each test case, print the area of (correct to a scale of one decimal place).

**Note:** Do not add any leading/trailing spaces or units; it is assumed that your result is in square units.

**Sample Input**

```
4
0 0
0 1
1 1
1 0
```

**Sample Output**

```
1
```

**Explanation**

The given polygon is a square, and each of its sides are unit in length.

, so we print on a new line.