Universal Cup Judging System

Universal Cup

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

You are given $N$ points on a 2D plane. The coordinates of the $i$-th point are $(x_i, y_i)$. You will mark some of these $N$ points such that the following condition is satisfied:

  • There is no convex quadrilateral whose four distinct vertices are among the marked points.

Find the maximum possible number of marked points.

Definition of Convex Quadrilateral

A quadrilateral formed by four distinct points on a plane is a convex quadrilateral if it satisfies all of the following conditions:

  • No three vertices are collinear.
  • Non-adjacent edges do not share a common point.
  • Every interior angle of the quadrilateral is strictly less than $180$ degrees.

Input

The input is given in the following format:

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

  • All input values are integers.
  • $4 \le N \le 500$
  • $|x_i|, |y_i| \le 10^8$
  • $(x_i, y_i) \ne (x_j, y_j)$ for $i \ne j$.

Output

Print the answer on a single line.

Examples

Input 1

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

Output 1

4

Input 2

5
0 0
1 1
2 2
2 3
3 2

Output 2

5

Input 3

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

Output 3

6

Input 4

4
0 0
2 0
1 -1
0 1

Output 4

3

Note

In the first example, you can mark four points excluding $(-1, 0)$. If you mark all points, there exists a convex quadrilateral whose vertices are four points excluding $(0, 0)$, which violates the condition.

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.