시간 제한메모리 제한제출정답맞힌 사람정답 비율
8 초 (추가 시간 없음) 2048 MB34222068.966%

문제

The Blind Association for Pretty Calligraphy is annoyed by the lack of emoticons and math symbols in the braille alphabet. Given that the braille alphabet is supported by the Unicode format, it only makes sense to make all Unicode characters supported in braille.

The goal is to extend the braille alphabet to include all Unicode characters. Of course, this will not fit in the standard $2 \times 3$ format, so using a bigger box is allowed. Important is that no two braille characters are the same up to translation, i.e., have the same shape. See Figure \ref{fig:braille} for an example. You let a designer make up a large braille alphabet, and your job is to check how many unique shapes there are among the characters.

Figure E.1: Illustration of Sample Input 1: two characters with the same shape.

입력

The input consists of:

  • One line with an integer $n$ ($1\leq n\leq 10^5$), the number of braille characters.
  • Then for each of the $n$ braille characters:
    • One line with an integer $m$ ($1 \leq m \leq 1000$), the number of dots.
    • $m$ lines, each with two integers $x$ and $y$ ($\left| x \right|, \left| y \right| \leq 1000$), the coordinates of the dots.
  • The total number of dots is at most $10^6$.

출력

Output the number of distinct braille characters up to translation.

예제 입력 1

2
2
0 2
1 1
2
0 1
1 0

예제 출력 1

1

예제 입력 2

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

예제 출력 2

2

출처

ICPC > Regionals > Europe > Northwestern European Regional Contest > Benelux Algorithm Programming Contest > BAPC 2022 Preliminaries E번

  • 문제를 만든 사람: Wessel van Woerden