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

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

Villa of Emblem Shape

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

요약
단순 다각형이 주어질 때, 평행이동한 여러 복사본을 겹쳐서 볼록 다각형을 만들 수 있는지 판정한다.
난이도

보통10점 중 7점

유형
기하, 그리디, 정렬
정답자
아직 제출이 없습니다

문제

The princess has a vast private estate. She has decided to build a new villa there.

According to her creative request, the ground floor outline of the main house of the villa must be derived from the emblem of the royal family. The emblem is a simple polygon. Four examples are shown in Figure F-1. The outline does not have to be the exact shape of the emblem; it can be formed by sliding and overlaying multiple copies of the emblem, like in Figure F-2. Any finite number of copies can be used, but all the copies should have the same size and orientation without being reversed.

Dataset 1Dataset 2Dataset 3Dataset 4

Figure F-1: The emblems in Sample Input

Figure F-2: An example of overlaying of copies for the first dataset of Sample Input

For security reasons, the outline must be a convex polygon. The rightmost of Figure F-2 is a convex polygon. Your task is to judge whether a convex polygon can be constructed by overlaying a finite number of copies of the emblem.

입력

The input consists of multiple datasets, each in the following format.

n

x1 y1

 ⋮

xn yn

n is the number of the vertices of the emblem, an integer between 3 and 200, inclusive. (xi, yi) gives the coordinates of the i-th vertex in the right-hand coordinate system (i = 1, …, n). Each of xi and yi is an integer between −10000 and 10000, inclusive. Any two vertices have different coordinates. The vertices are listed in a counterclockwise order. Any two edges of the emblem do not have a common point other than their connecting vertex. For each vertex, the angle of the two edges is not 180 degrees.

The end of the input is indicated by a line consisting of a zero. The input consists of at most 500 datasets.

출력

For each dataset, output in a line Yes if a convex polygon can be constructed, and No, otherwise.

예제1

  1. 예제 1

    입력
    12
    -5 -7
    5 -7
    5 -3
    1 -3
    1 3
    5 3
    5 7
    -5 7
    -5 3
    -1 3
    -1 -3
    -5 -3
    7
    0 0
    7 1
    3 2
    2 4
    6 9
    4 10
    1 7
    14
    0 1
    2 0
    3 1
    2 4
    0 4
    1 2
    -1 1
    0 3
    -1 4
    -2 4
    -3 3
    -2 -3
    -1 -3
    0 -2
    5
    -2 0
    1 -4
    2 -3
    2 3
    1 4
    0
    
    예상 출력
    Yes
    No
    Yes
    Yes