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

23123번 - Hamiltonian 스페셜 저지다국어

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

문제

You are given a positive integer $K \le 60$. Construct a graph with at most 20ドル$ vertices with the following property: there are exactly $K$ unordered pairs of vertices $(u, v)$ such that there is a Hamiltonian path between $u$ and $v$ in this graph.

It can be shown that, under these constraints, the solution always exists.

Recall that a Hamiltonian path is a path between two vertices of a graph that visits each vertex exactly once.

입력

The only line of the input contains a single integer $K$ (1ドル \le K \le 60$).

출력

On the first line, output two integers $n$ and $m$ (2ドル \le n \le 20,ドル 0ドル \le m \le \frac{n(n-1)}{2}$), the number of vertices and the number of edges in your graph respectively.

In each of the next $m$ lines, output two integers $u$ and $v$ (1ドル \le u, v \le n,ドル $u \neq v$), representing the edge $(u, v)$ of your graph. All edges have to be distinct.

제한

예제 입력 1

1

예제 출력 1

2 1
1 2

예제 입력 2

2

예제 출력 2

4 4
1 2
1 3
2 3
3 4

예제 입력 3

3

예제 출력 3

3 3
1 2
2 3
3 1

힌트

출처

Camp > Petrozavodsk Programming Camp > Summer 2021 > Day 3: IQ test by kefaa2, antontrygubO_o, and gepardo H번

Contest > Open Cup > 2021/2022 Season > Stage 2: Grand Prix of IMO H번

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

출처

대학교 대회

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

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