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

18665번 - IQ Test 스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 512 MB69725320536.477%

문제

You are given a set S of integers. Initially, S contains 0, 1, and 2.

You can perform zero or more steps. On each step, you choose two elements (possibly equal) x and y such that x ∈ S and y ∈ S, and insert the number x2 − y into the set S.

You can not perform more than 43 steps.

Your task is to get the integer n in your set.

입력

The first line contains a single integer n (0 ≤ n ≤ 1018), the number you have to get in the set.

출력

For each step, print x and y on a separate line. The condition 0 ≤ x2 − y ≤ 1018 must be satisfied.

The number of steps must be at most 43. Note that you don’t have to minimize it. If there are several possible solutions, print any one of them.

제한

예제 입력 1

5

예제 출력 1

1 1
2 1
2 0
3 4

예제 입력 2

7

예제 출력 2

1 1
2 1
3 2

힌트

출처

Camp > Petrozavodsk Programming Camp > Summer 2019 > Day 9: MEX Foundation Contest F번

  • 데이터를 추가한 사람: cgiosy
(追記) (追記ここまで)

출처

대학교 대회

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

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