#P15933. [TOPC 2021] Eatcoin

[TOPC 2021] Eatcoin

题目描述

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 dd-th day of the execution of Eric’s algorithm, it consumes pp Eatcoins and then produces q×d5q \times d^5 Eatcoins where pp and qq are positive constants.

Eric wants to become a “duotrigintillionaire”. A duotrigintillionaire is a person who has at least 109910^{99} 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 pp Eatcoins when needed.

Eric gives the values of pp and qq to you. Please write a program to help Eric to compute two numbers xx and yy defined as follows.

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

输入格式

Two positive integers pp and qq are given in one line and separated by a space.

输出格式

Output two lines. Print xx on the first line and yy on the second line.

50 1
117
42627697484524538
10 10
10
29041912218408574

提示

  • 1qp10181 \leq q \leq p \leq 10^{18}