Universal Cup Judging System

Universal Cup

Time Limit: 2.0 s Memory Limit: 1024 MB Total points: 100
Statistics

На двовимірній площині дано $N$ точок. Координати $i$-ї точки дорівнюють $(x_i, y_i)$. Ви хочете позначити деякі з цих $N$ точок так, щоб виконувалася така умова:

  • Не існує опуклого чотирикутника, усі чотири різні вершини якого лежать серед позначених точок.

Знайдіть максимально можливу кількість позначених точок.

Визначення опуклого чотирикутника

Чотирикутник, утворений чотирма різними точками на площині, називається опуклим чотирикутником, якщо він задовольняє всі наведені нижче умови:

  • Жодні три вершини не лежать на одній прямій.
  • Несуміжні сторони не мають спільних точок.
  • Кожен внутрішній кут чотирикутника строго менший за $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

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, 0)$. Якщо позначити всі точки, то існуватиме опуклий чотирикутник, вершинами якого є чотири точки, крім $(0, 0)$, що порушує умову.

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.