QOJ.ac

QOJ

Time Limit: 2 s Memory Limit: 256 MB Total points: 100

#21223. معركة البقر في البريدج

Statistics

تنتظر أبقار Farmer John البالغ عددها $N$ ($4 \le N \le 1,000$) بصبر في المرعى الرئيسي. البقرة $i$ عند النقطة ذات الإحداثيين الصحيحين ($X_{i}$, $Y_{i}$)، حيث $-1,000,000,000 \le X_{i} \le 1,000,000,000; -1,000,000,000 \le Y_{i} \le 1,000,000,000$.

تريد تشكيل مجموعات من أربع للعب البريدج، لعبتها الجديدة المفضلة بالورق. هناك شرط مهم: المجموعة مسموحة إذا وفقط إذا وجدت نقطة $X$ في المستوى، لا تطابق أي موضع من الأربعة، بحيث تدوير أي بقرة $180$ درجة حول $X$ ينقلها إلى موضع بقرة أخرى في المجموعة.

حدّد عدد مجموعات الأبقار الأربع التي يمكنها تشكيل مجموعة بريدج صحيحة.

مثلًا، لنفترض أن ثماني أبقار عند النقاط الثماني التالية:

                  |
                 f*
                  |             a = (-3, 1)    e = (-1, 1)
           b*     |             b = (-2, 2)    f = ( 0, 3)
        a      e  |             c = (-3, 0)    g = ( 2, 0)
         *     *  |             d = (-2, 0)    h = ( 3, 0)
         c  d     |     g  h
---------*--*-----+-----*--*---------
                  |

المجموعات الصحيحة الثلاث هي $\{a,b,e,d\}$ (دوران حول $(-2,1)$)، و$\{b,c,e,f\}$ (حول $(-1.5,1.5)$)، و$\{c,d,g,h\}$ (حول $(0,0)$).

كل المواضع مختلفة وتُعطى بلا ترتيب محدد. الإجابة تلائم عددًا صحيحًا ذا إشارة من 32 بت.

الإدخال

  • السطر 1: عدد صحيح $N$.
  • الأسطر $2 \ldots N+1$: يحتوي السطر $i+1$ على عددين صحيحين مفصولين بمسافة، $X_{i}$ و$Y_{i}$.

الإخراج

  • السطر 1: عدد صحيح يعد مجموعات الأبقار الأربع الصحيحة للعب البريدج.

أمثلة

الإدخال 1

8
-3 0
-2 0
-1 1
0 3
2 0
-3 1
3 0
-2 2

الإخراج 1

3

مؤلف المسألة: Richard Ho, 2007

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.