408901: GYM103373 E Eatcoin

Memory Limit:1024 MB Time Limit:3 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

E. Eatcointime limit per test3 secondsmemory limit per test1024 megabytesinputstandard inputoutputstandard output

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\times d^5$$$ Eatcoins where $$$p$$$ and $$$q$$$ are positive constants.

Eric wants to become a "duotrigintillionaire". A duotrigintillionaire is a person who has at least $$$10^{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 $$$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.
Input

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

  • $$$1\le q \le p \le 10^{18}$$$
Output

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

ExamplesInput
50 1
Output
117
42627697484524538
Input
10 10
Output
10
29041912218408574

加入题单

算法标签: