#C7307. Maximum Triangle Area

    ID: 51164 Type: Default 1000ms 256MiB

Maximum Triangle Area

Maximum Triangle Area

You are given a set of points on the plane. Your task is to determine the maximum area of any triangle that can be formed by choosing three distinct points from the set.

The area of a triangle with vertices ((x_1,y_1)), ((x_2,y_2)), and ((x_3,y_3)) can be computed using the determinant formula:

[ A = \frac{1}{2} \left| x_1(y_2-y_3) + x_2(y_3-y_1) + x_3(y_1-y_2) \right| ]

For each test case, if no triangle can be formed, output 0.000000. Otherwise, print the maximum area found formatted to six decimal places.

inputFormat

Input is read from standard input. The first line contains an integer (t), the number of test cases. For each test case:

  • The first line contains an integer (n), denoting the number of points.
  • The next (n) lines each contain two space-separated integers (x) and (y), representing the coordinates of a point.

outputFormat

Output the maximum triangle area for each test case on a new line. The area must be printed with exactly six decimal places.## sample

1
3
0 0
0 1
1 0
0.500000

</p>