## Algorithm

C. Photo of The Sky
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

Pavel made a photo of his favourite stars in the sky. His camera takes a photo of all points of the sky that belong to some rectangle with sides parallel to the coordinate axes.

Strictly speaking, it makes a photo of all points with coordinates (x,y)(�,�), such that x1xx2�1≤�≤�2 and y1yy2�1≤�≤�2, where (x1,y1)(�1,�1) and (x2,y2)(�2,�2) are coordinates of the left bottom and the right top corners of the rectangle being photographed. The area of this rectangle can be zero.

After taking the photo, Pavel wrote down coordinates of n of his favourite stars which appeared in the photo. These points are not necessarily distinct, there can be multiple stars in the same point of the sky.

Pavel has lost his camera recently and wants to buy a similar one. Specifically, he wants to know the dimensions of the photo he took earlier. Unfortunately, the photo is also lost. His notes are also of not much help; numbers are written in random order all over his notepad, so it's impossible to tell which numbers specify coordinates of which points.

Pavel asked you to help him to determine what are the possible dimensions of the photo according to his notes. As there are multiple possible answers, find the dimensions with the minimal possible area of the rectangle.

Input

The first line of the input contains an only integer n (1n1000001≤�≤100000), the number of points in Pavel's records.

The second line contains 2n2⋅� integers a1�1a2�2, ..., a2n�2⋅� (1ai1091≤��≤109), coordinates, written by Pavel in some order.

Output

Print the only integer, the minimal area of the rectangle which could have contained all points from Pavel's records.

Examples
input
Copy
44 1 3 2 3 2 1 3
output
Copy
1
input
Copy
35 8 5 5 7 5
output
Copy
0
Note

In the first sample stars in Pavel's records can be (1,3)(1,3)(1,3)(1,3)(2,3)(2,3)(2,4)(2,4). In this case, the minimal area of the rectangle, which contains all these points is 11 (rectangle with corners at (1,3)(1,3) and (2,4)(2,4)).

## Code Examples

### #1 Code Example with C++ Programming

Code - C++ Programming

#include <bits/stdc++.h>

using namespace std;

int const N = 2e5 + 1;
int n, a[N];

int main() {
scanf("%d", &n);
for(int i = 0; i < 2 * n; ++i)
scanf("%d", a + i);
sort(a, a + 2 * n);

long long res = 1ll * (a[n - 1] - a[0]) * (a[2 * n - 1] - a[n]);

for(int i = 1, j = n; i < n; ++i, ++j)
res = min(res, 1ll * (a[2 * n - 1] - a[0]) * (a[j] - a[i]));

printf("%lld\n", res);

return 0;
}
Copy The Code &

Input

cmd
4
4 1 3 2 3 2 1 3

Output

cmd
1