아직 만들고 있는 페이지입니다.

이 페이지는 아직 만드는 중입니다. 보이는 내용은 바뀔 수 있습니다.

AI Jeopardy

시간 제한1초메모리 제한512 MB

요약
큰 정수 X가 주어질 때 C(n,k) = X인 n과 k를 찾고, n을 최소로 한 뒤 k를 최소로 한다.
난이도

보통10점 중 7점

유형
정수론, 수학, 이분 탐색
정답자
아직 제출이 없습니다

문제

The robot revolution is finally here, albeit not quite in the highly explosive way envisioned in various science fiction books and movies. It seems that, perhaps due to a small typo in the AI source code, the robots are not taking our lives but instead taking our livelihoods. One early job market fatality in this revolution was the (somewhat niche) occupation as jeopardy player: already in 2011 the Watson computer defeated two legendary but inferior human jeopardy champions.

Nowadays, more and more of Jeopardy's viewers are AIs themselves and as such the show is considering having categories on topics that are more popular with this new number-crunching viewer base.  Focus group testing has revealed that AIs are particularly fond of the "Binomial Coefficients" category.  The premise of this category is that the answer that contestants get is some positive integer XX, and the contestants must respond with a question of the form "What is nn choose kk?" (and this is a correct response if the binomial coefficient nn choose kk equals XX).

Write an AI to play this new Jeopardy category.  If there are several different possible solutions for nn and kk, the AI should choose the most elegant solution, having the smallest value of nn, and of those with the smallest nn it should choose the one with the smallest value of kk.

입력

Input consists of a single integer XX (1≤X≤101001 \le X \le 10^{100}).

출력

Output two non-negative integers nn and kk such that the binomial coefficient nn choose kk equals XX, with ties between multiple solutions broken as explained above.

예제3

  1. 예제 1

    입력
    10
    
    예상 출력
    5 2
    
  2. 예제 2

    입력
    2020
    
    예상 출력
    2020 1
    
  3. 예제 3

    입력
    1
    
    예상 출력
    0 0