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

16069번 - Hyper Illuminati 스페셜 저지다국어

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

문제

Once again the time dawns to demonstrate the sheer power of the Illuminati. To do so, it was decided to build an n-dimensional hyper-step pyramid using n-dimensional blocks:

  • All the steps of the pyramid are n-dimensional hyper-cuboids.
  • Every step has a height of exactly 1 block in the n-th dimension.
  • The pyramid has s steps and the base step is s blocks long in every other of the n − 1 dimensions.
  • Every subsequent higher step is 1 block shorter in each of the n − 1 dimensions than the step below it.
  • The top step is exactly 1 block.

To prove their might even further the Illuminati leaders have decided to add two more requirements:

  • n must be at least 3.
  • The number of blocks used to build the pyramid must be a meaningful number.

Figure H.1: A 3-dimensional hyper pyramid with 3 steps consisting of 14 blocks in total.

입력

The input consists of:

  • one line with a single integer m (1 ≤ m ≤ 1016) . This integer is the meaningful number the leaders have chosen.

출력

If a hyper-step pyramid matching all the requirements exists, output a single line with two integers n and s, the dimension of the pyramid and its number of steps. If none exists, output impossible. If multiple solutions exist, any will be accepted.

제한

예제 입력 1

14

예제 출력 1

3 3

예제 입력 2

9

예제 출력 2

4 2

예제 입력 3

24

예제 출력 3

impossible

예제 입력 4

9134731356568978

예제 출력 4

5 2147

힌트

출처

ICPC > Regionals > Europe > Northwestern European Regional Contest > German Collegiate Programming Contest > GCPC 2018 H번

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

출처

대학교 대회

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

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