Universal Cup Judging System

Universal Cup

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

2차원 평면 위에 $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.