Logo
(追記) (追記ここまで)

33409번 - Geometry Enjoyer 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
7 초 2048 MB5000.000%

문제

Altair was playing with the points on the plane (as usual). At some point, he discovered a new game that he will play with you.

He made a convex polygon with $k$ sides on the two-dimensional plane. The polygon had a really nice property: no pair of sides are parallel. Then he extended every side of the polygon to a line, and found the intersection point for every pair of lines.

Now he gives you the points he got. You should find the initial polygon.

입력

The first line contains one integer $n$ (1ドル \leq n \leq 200$): the number of points.

Each of the next $n$ lines contains four integers, $p_x,ドル $q_x,ドル $p_y,ドル and $q_y$ ($-10^6 \le p_x, p_y \le 10^6,ドル 1ドル \le q_x, q_y \le 10^6$): the coordinates of the $i$-th point. The $X$ coordinate equals $p_x / q_x,ドル and the $Y$ coordinate equals $p_y / q_y$. It is guaranteed that the values $p_x$ and $q_x$ are coprime, and the values $p_y$ and $q_y$ are coprime.

It is guaranteed that the polygon can be uniquely determined by the given points.

출력

The first line of the output should contain one integer $k$: the size of the polygon.

You can output the vertices of the polygon in any order.

Each of the next $k$ lines should contain four integers, $p_x,ドル $q_x,ドル $p_y,ドル and $q_y$ ($-10^6 \le p_x, p_y \le 10^6,ドル 1ドル \le q_x, q_y \le 10^6$): the coordinates of the polygon vertices. The $X$ coordinate equals $p_x / q_x,ドル and the $Y$ coordinate equals $p_y / q_y$. The values $p_x$ and $q_x$ should be coprime, and the values $p_y$ and $q_y$ should be coprime.

제한

예제 입력 1

6
1 1 2 1
12 5 24 5
0 1 0 1
3 1 3 1
-3 1 0 1
4 1 0 1

예제 출력 1

4
0 1 0 1
1 1 2 1
3 1 3 1
4 1 0 1

힌트

출처

Camp > Petrozavodsk Programming Camp > Winter 2024 > Day 7: Kazakhstan Contest G번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /