Time Limit: Java: 1000 ms / Others: 1000 ms
Memory Limit: Java: 32768 KB / Others: 32768 KB
Given n points (xi, yi) (i = 1, 2 ... n) in a plane, where all xi will be distinct. After connecting the n points with staight lines in order from the leftmost point to the rightmost point, the area below the lines is called coverage. Now, it's your job to calculate the maximum coverage area, if yi (i = 1, 2 ... n) can be swapped arbitrarily.
The first line of the input is an integer t (t <= 100), indicate the number of cases.
Each case starts with one integer n (2 <= n <= 1000) in a line. Then follows n lines, each consists of two integers x y (1 <= x, y <= 105) representing a point.
Cases are separated by one blank line.