Skip to main content
Tuesday (24.11.2026) at 20:00: ALGOR Contest: Round #4 (Special Challenge) starts!

~/algor $ cat problems/eng-katta-uchburchak

Largest triangle

Medium 1000 ms 128 MB 51%
Share

$n$ points are given on the plane. Choose three of them to form a triangle of the largest area. To keep the answer an integer, print twice the largest area ($0$ if all the points lie on one line).

Points on the plane; the largest triangle formed by three of them

Input

The first line contains a positive integer $n$. Each of the next $n$ lines contains two integers: $x_{i}$ and $y_{i}$.

Output

One integer — twice the largest area.

Note

$3 \le n \le 100$
$-10^{6} \le x_{i}, y_{i} \le 10^{6}$

Examples

Input #1
5
0 0
4 0
1 1
2 3
0 2
Output #1
12
Input #2
3
0 0
1 1
2 2
Output #2
0

Sign in to submit a solution

Signing up is free and takes a minute.