Universal Cup Judging System

Universal Cup

実行時間制限: 2.0 s メモリ制限: 1024 MB 満点: 100
統計

$2$ 次元平面上に $N$ 個の点が与えられます。$i$ 番目の点の座標は $(x_i, y_i)$ です。あなたはこれら $N$ 個の点のうちいくつかに印を付け、以下の条件が満たされるようにします:

  • 印を付けた点の中から選んだ相異なる $4$ 点を頂点とする凸四角形が存在しない。

印を付けることができる点の個数の最大値を求めてください。

凸四角形の定義

平面上の相異なる $4$ 点によって形成される四角形が以下の条件をすべて満たすとき、それを凸四角形と呼びます:

  • どの $3$ 頂点も同一直線上にない。
  • 隣接しない辺同士が共有点を持たない。
  • 四角形のすべての内角が $180$ 度未満である。

入力

入力は以下の形式で与えられます:

$$\begin{aligned} &N \\ &x_1 \ y_1 \\ &x_2 \ y_2 \\ &\vdots \\ &x_N \ y_N \end{aligned}$$

  • 入力される値はすべて整数である。
  • $4 \le N \le 500$
  • $|x_i|, |y_i| \le 10^8$
  • $(x_i, y_i) \ne (x_j, y_j)$ ($i \ne j$)。

出力

答えを $1$ 行で出力してください。

入出力例

入力例 1

5
0 0
-1 0
0 -1
1 0
0 1

出力例 1

4

入力例 2

5
0 0
1 1
2 2
2 3
3 2

出力例 2

5

入力例 3

7
-1 8
11 8
-4 -2
19 12
-8 -6
7 6
-1 2

出力例 3

6

入力例 4

4
0 0
2 0
1 -1
0 1

出力例 4

3

注記

$1$ 番目の例では、$(-1, 0)$ を除く $4$ つの点に印を付けることができます。もしすべての点に印を付けると、$(0, 0)$ を除く $4$ つの点を頂点とする凸四角形が存在してしまい、条件に違反します。

Editorials

IDTypeStatusTitlePosted ByLast UpdatedActions
#1407EditorialOpen题解jianglyView

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.