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

23338번 - Eatcoin 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
3 초 (추가 시간 없음) 1024 MB72413557.377%

문제

Eric developed a new algorithm to mine a cryptocurrency called Eatcoin. Since Eric’s algorithm is an evolutionary algorithm, its performance keeps improving. On the d-th day of the execution of Eric’s algorithm, it consumes p Eatcoins and then produces q × d5 Eatcoins where p and q are positive constants.

Eric wants to become a “duotrigintillionaire”. A duotrigintillionaire is a person who has at least 1099 Eatcoins. Eric plans to exploit his algorithm to achieve his goal. Eric’s algorithm can soon produce a massive amount of Eatcoins if he has enough Eatcoins. However, his algorithm cannot continue if he does not have p Eatcoins when needed.

Eric gives the values of p and q to you. Please write a program to help Eric to compute two numbers x and y defined as follows.

  • x is the minimum number of Eatcoins required to execute Eric’s algorithm to make him a duotrigintillionaire.
  • y is the minimum number of days required to make Eric a duotrigintillionaire if Eric has exactly x Eatcoins before executing his algorithm.

입력

Two positive integers p and q are given in one line and separated by a space.

출력

Output two lines. Print x on the first line and y on the second line.

제한

  • 1 ≤ q ≤ p ≤ 1018

예제 입력 1

50 1

예제 출력 1

117
42627697484524538

예제 입력 2

10 10

예제 출력 2

10
29041912218408574

힌트

출처

ICPC > Regionals > Asia Pacific > Taiwan > Taiwan Online Programming Contest > TOPC 2021 E번

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

출처

대학교 대회

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

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