CS Building Blueprint

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

요약
임의의 순서로 주어진 네 점이 볼록 사각형을 이룰 때, 변의 길이와 평행, 직각 여부를 따져 도형을 분류한다.
난이도

쉬움10점 중 3점

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

문제

Mines has recently received an influx of new students who are interested in studying Computer Science (the best major on campus, naturally). To accommodate this new influx, Mines has decided to build a new Computer Science building. The building architects designed the building to be a quadrilateral, but Blaster the Burro ate the blueprints! All they have left are coordinates of the four vertices of the building. Can you determine the shape of the building they designed?

입력

The input consists of four lines of space separated integers. The two integers on each line represent the xx and yy coordinates of a point in two-dimensional Cartesian space, respectively. The four points are guaranteed to form a convex quadrilateral (that is, all interior angles are strictly less than 180∘180^\circ), but the points may appear in any order. The xx and yy coordinates of each point are in the range \[−1,000,1,000]\[-1\\,000, 1\\,000].

출력

The output should be a string describing the most specific classification of the shape that the four points form. You should classify the points as forming one of the following shapes, listed in increasing order of specificity:

  • Quadrilateral: a polygon with four edges and four vertices
  • Kite: a quadrilateral with two pairs of adjacent sides with equal length
  • Trapezoid: a quadrilateral with at least one pair of opposite sides that are parallel
  • Parallelogram: a trapezoid with two pairs of opposite sides that are parallel
  • Rhombus: a parallelogram with four sides of equal length
  • Rectangle: a parallelogram with four right angles
  • Square: a rectangle with four sides of equal length

예제2

  1. 예제 1

    입력
    1 1
    1 -1
    -1 -1
    -1 1
    
    예상 출력
    Square
    
  2. 예제 2

    입력
    15 5
    30 24
    35 17
    10 12
    
    예상 출력
    Parallelogram