#P11023. Maximizing Convex Hull Area with Mandatory Points

    ID: 13075 Type: Default 1000ms 256MiB

Maximizing Convex Hull Area with Mandatory Points

Maximizing Convex Hull Area with Mandatory Points

Given N points on a 2D plane, select K points such that the area of their convex hull is maximized. Additionally, you must choose the two points with the smallest and largest x-coordinates. It is guaranteed that on the vertical lines (x=x_{min}) and (x=x_{max}) there are no other points and that these two points have (y=0).

The convex hull area is computed using the formula:
[ \text{Area} = \frac{1}{2}\left|\sum_{i=1}^{m}(x_i y_{i+1} - x_{i+1} y_i)\right|, ] where the vertices ((x_i,y_i)) (with (x_{m+1}=x_1, y_{m+1}=y_1)) are ordered in a counterclockwise direction. Only output the maximum area.

inputFormat

The first line contains two integers (N) and (K).

Each of the next (N) lines contains two space-separated integers (x) and (y), representing the coordinates of a point.

outputFormat

Output a single floating-point number (rounded to one decimal place) representing the maximum area achievable by selecting (K) points that satisfy the conditions.

sample

4 3
0 0
1 2
2 0
1 1
2.0