#C6315. Largest Rectangle Area
Largest Rectangle Area
Largest Rectangle Area
Given a set of coordinates on a 2D plane, your task is to compute the largest area of a rectangle whose sides are parallel to the axes. A rectangle is defined by four distinct points (x1, y1), (x1, y2), (x2, y1), and (x2, y2) such that all these points exist in the input. If no such rectangle can be formed, output 0.
The input first contains an integer n (the number of points). Each of the following n lines contains two integers representing the x and y coordinates of a point. The rectangle must have non-zero area. The area of a rectangle formed by two points (x1, y1) and (x2, y2) is computed as \( |x_2 - x_1| \times |y_2 - y_1| \).
Example:
Input: 4 1 1 1 3 3 1 3 3</p>Output: 4
inputFormat
The first line contains an integer n, which indicates the number of points. Each of the next n lines contains two space-separated integers representing the x and y coordinates of a point.
outputFormat
Output a single integer representing the largest rectangle area that can be formed with sides parallel to the axes. If no rectangle can be formed, output 0.
## sample4
1 1
1 3
3 1
3 3
4