아직 만들고 있는 페이지입니다.

이 페이지는 아직 만드는 중입니다. 보이는 내용은 바뀔 수 있습니다.

Extended Braille

시간 제한8초메모리 제한2048 MB

요약
정수 좌표로 이루어진 n개의 점 집합이 주어질 때, 평행이동으로 같아지는 것을 하나로 묶어 서로 다른 모양의 개수를 센다.
난이도

보통10점 중 5점

유형
해시맵, 정렬, 구현, 기하
정답자
아직 제출이 없습니다

문제

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×32 \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 nn (1≤n≤1051\leq n\leq 10^5), the number of braille characters.

  • Then for each of the nn braille characters:

    • One line with an integer mm (1≤m≤10001 \leq m \leq 1000), the number of dots.
    • mm lines, each with two integers xx and yy (∣x∣,∣y∣≤1000\left| x \right|, \left| y \right| \leq 1000), the coordinates of the dots.
  • The total number of dots is at most 10610^6.

출력

Output the number of distinct braille characters up to translation.

예제2

  1. 예제 1

    입력
    2
    2
    0 2
    1 1
    2
    0 1
    1 0
    
    예상 출력
    1
    
  2. 예제 2

    입력
    2
    3
    -1 0
    0 1
    1 0
    3
    -1 0
    0 -1
    1 0
    
    예상 출력
    2