Mirror, Mirror...

시간 제한2초메모리 제한512 MB

요약
서로 다른 정수 좌표 점 N개가 주어질 때, 어떤 직선에 대해 대칭인 부분집합 가운데 크기가 가장 큰 것을 찾는다.
난이도

어려움10점 중 8점

유형
기하, 해시맵, 정렬, 완전 탐색
정답자
아직 제출이 없습니다

문제

Mirror, mirror, on the wall, which mirror symmetric subset of these points is the largest of them all?

The set PP consists of NN points. We say that a subset S⊆PS \subseteq P is \emph{mirror symmetric} if there exists a line ℓ\ell such that for each point p∈Sp \in S, the reflection of pp across ℓ\ell is also in SS.

Given the set PP, what is the largest size of any mirror symmetric subset?

입력

The first line of the input contains NN, the number of points. The next NN lines each consist of two integers x_i,y_ix\_i, y\_i (−30,000≤x_i,y_i≤30,000-30\\,000 \le x\_i, y\_i \le 30\\,000), the coordinates of each point.

There will be no duplicate points in the input.

출력

Output a single integer -- the largest size of a mirror symmetric subset.

제한

  • 1≤N≤15001 \leq N \leq 1500

예제1

  1. 예제 1

    입력
    7
    2 4
    5 5
    5 4
    4 2
    3 0
    0 3
    0 1
    
    예상 출력
    5