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.