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

19298번 - Number of Cycles 스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 512 MB911100.000%

문제

Jaehyun likes computational geometry. Here is Jaehyun's question: "We are given $n$ segments on the Cartesian plane. Count the number of simple cycles in the generated graph."

Formally, a set of $n$ segments $S = \{s_1, s_2, \ldots, s_n\}$ generates the following graph $G = (V, E)$.

For a point $v$ of the plane, $v \in V$ if $v$ is one of the endpoints of the segments or $v$ is an intersection of two or more segments.

For two distinct vertices $u$ and $v,ドル $(u, v) \in E$ if there is a segment $s_i \in S$ containing vertices $u$ and $v,ドル and there is no vertex on $s_i$ between $u$ and $v$.

A simple cycle is a cycle with no repeated vertices or edges.

Zigui tried to solve Jaehyun's problem, and he found it is possible to make various answers with just a few segments.

For given $N,ドル find a set of segments such that the number of simple cycles in the graph generated by these segments is $N$.

입력

The first line contains an integer $N$ (1ドル \le N \le 1000$).

출력

The first line of the output must contain an integer $K$: the number of segments (1ドル \le K \le 12$).

Each of the next $K$ lines must contain four integers $x_{1},ドル $y_{1},ドル $x_{2},ドル and $y_{2}$ denoting a segment with endpoints $(x_{1}, y_{1})$ and $(x_{2}, y_{2})$ ($-10^{9} \le x_{1}, y_{1}, x_{2}, y_{2} \le 10^{9},ドル $(x_{1}, y_{1}) \neq (x_{2}, y_{2})$).

제한

예제 입력 1

1

예제 출력 1

3
0 0 0 1
1 0 0 1
1 0 0 0

예제 입력 2

3

예제 출력 2

4
-5 -5 5 5
-5 5 5 -5
-5 -1 5 -1
0 -5 0 5

힌트

출처

Camp > Petrozavodsk Programming Camp > Winter 2018 > Day 5: Grand Prix of Korea H번

Contest > Open Cup > 2017/2018 Season > Stage 10: Grand Prix of Korea H번

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

출처

대학교 대회

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

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