#P11023. [COTS 2020] 王国 Kraljevstvo

    ID: 12436 远端评测题 1000ms 500MiB 尝试: 0 已通过: 0 难度: 8 上传者: 标签>2020O2优化斜率优化四边形不等式凸包COCI(克罗地亚)

[COTS 2020] 王国 Kraljevstvo

Background

Translated from Izborne Pripreme 2020 (Croatian IOI/CEOI Team Selection) D1T1。1s,0.5G\texttt{1s,0.5G}

Problem Description

You are given NN points on a 2D plane. Choose KK points to maximize the area of the convex hull of these KK points.

In addition, you must choose the two points with the minimum and maximum xx coordinates on the plane. It is guaranteed that there are no other points on the two lines parallel to the yy axis that pass through these two points, and the yy coordinates of these two points are 00.

You only need to output the maximum area.

Input Format

The first line contains two positive integers N,KN, K.

The next NN lines each contain two integers xi,yix_i, y_i, describing a point.

Output Format

Output one real number on a single line, representing the maximum convex hull area.

The output should not contain extra leading zeros or trailing zeros.

6 4
0 0
9 0
2 8
6 5
2 -7
8 -7
67.5
5 3
0 0
10 0
5 0
5 5
5 -5
25
8 5
0 0
15 0
2 -2
4 12
10 -14
6 -12
2 -10
13 10
238

Hint

  • Explanation for Sample 11: choose (0,0),(2,7),(2,8),(9,0)(0, 0), (2, −7), (2, 8), (9, 0).
  • Explanation for Sample 22: choose (0,0),(10,0),(5,5)(0, 0), (10, 0), (5, −5).

You may also refer to the figure below.

Constraints

For 100%100\% of the testdata, it is guaranteed that:

  • 3KN30003 \le K \le N \le 3\,000
  • xi,yi109|x_i|, |y_i| \le 10^9
  • All given points are distinct;
  • The points with the minimum and maximum xx coordinates are unique, and their corresponding yy coordinates are 00
Subtask ID NN \le Score
11 2020 1111
22 100100 2525
33 500500 1515
44 30003\,000 4949

Translated by ChatGPT 5