Geometry Game

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

요약
시계 방향으로 주어진 볼록 사각형의 네 점이 정사각형, 직사각형, 마름모, 평행사변형, 사다리꼴, 연 중 가장 구체적으로 어떤 도형인지 판별한다.
난이도

보통10점 중 4점

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

문제

For the longest time you could keep your toddlers happy by letting them play with triangular, square, and circular wooden blocks that fit exactly through perfectly sized holes. After letting them play a bit too long, they completely mastered this game and are now bored, preventing you from fixing the bugs in your code.

Just now, they decided to reverse roles and started screaming planar coordinates at you, insisting that you determine which shape each four points make: kite, trapezium, parallelogram, rhombus, rectangle, square, or none of those. You do not have time for this, since your bugs still need fixing. Instead, you write a new program to answer your toddlers' questions, ideally without bugs.

The definitions for the quadrilateral shapes are as follows:

  • A square has four right angles and four sides with equal lengths.
  • A rectangle has four right angles.
  • A rhombus has four sides with equal lengths.
  • A parallelogram has two pairs of parallel sides.
  • A trapezium has one pair of parallel sides.
  • A kite has reflection symmetry across a diagonal.

입력

The input consists of:

  • Four lines, each containing two integers xx and yy (0≤x,y≤1090\leq x,y\leq 10^9), the coordinates of a point.

The positive x-axis is oriented to the right and the positive y-axis is oriented upwards.

The four points are distinct, form a convex quadrilateral shape (i.e. all interior angles are strictly less than 180∘180^\circ), and are given in clockwise order.

출력

Output the most restrictive type of quadrilateral that the points form, which is the first one of "square", "rectangle", "rhombus", "parallelogram", "trapezium", or "kite" that applies, or "none" otherwise.

예제2

  1. 예제 1

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

    입력
    1 1
    2 3
    4 5
    3 3
    
    예상 출력
    parallelogram