QOJ.ac

QOJ

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

#21223. Kuh-Bridge-Duell

Statistics

Farmer Johns $N$ Kühe ($4 \le N \le 1,000$) warten geduldig auf der Hauptweide. Kuh $i$ steht am ganzzahligen Punkt ($X_{i}$, $Y_{i}$), mit $-1,000,000,000 \le X_{i} \le 1,000,000,000; -1,000,000,000 \le Y_{i} \le 1,000,000,000$.

Sie wollen Vierergruppen für ihr neues Lieblingskartenspiel Bridge bilden. Wichtig ist: Eine Gruppe ist genau dann erlaubt, wenn es einen Punkt $X$ der Ebene gibt, der von allen vier Positionen verschieden ist, sodass die Drehung jeder Kuh um $180$ Grad um $X$ sie an die Position einer anderen Kuh der Gruppe bringt.

Bestimme die Anzahl von Vierermengen, die eine gültige Bridge-Gruppe bilden können.

Als Beispiel stehen acht Kühe an diesen acht Punkten:

                  |
                 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
---------*--*-----+-----*--*---------
                  |

Die drei gültigen Mengen sind $\{a,b,e,d\}$ (Drehzentrum $(-2,1)$), $\{b,c,e,f\}$ (Zentrum $(-1.5,1.5)$) und $\{c,d,g,h\}$ (Zentrum $(0,0)$).

Die Positionen sind alle verschieden und werden in keiner bestimmten Reihenfolge angegeben. Die Antwort passt in eine vorzeichenbehaftete 32-Bit-Ganzzahl.

Eingabe

  • Zeile 1: eine ganze Zahl $N$.
  • Zeilen $2 \ldots N+1$: Zeile $i+1$ enthält zwei durch Leerzeichen getrennte ganze Zahlen $X_{i}$ und $Y_{i}$.

Ausgabe

  • Zeile 1: eine ganze Zahl, die die gültigen Vierermengen für Bridge zählt.

Beispiele

Eingabe 1

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

Ausgabe 1

3

Aufgabenautor: 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.