#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 -th day of the execution of Eric’s algorithm, it consumes Eatcoins and then produces Eatcoins where and are positive constants.
Eric wants to become a “duotrigintillionaire”. A duotrigintillionaire is a person who has at least 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 Eatcoins when needed.
Eric gives the values of and to you. Please write a program to help Eric to compute two numbers and defined as follows.
- is the minimum number of Eatcoins required to execute Eric’s algorithm to make him a duotrigintillionaire.
- is the minimum number of days required to make Eric a duotrigintillionaire if Eric has exactly Eatcoins before executing his algorithm.
输入格式
Two positive integers and are given in one line and separated by a space.
输出格式
Output two lines. Print on the first line and on the second line.
50 1
117
42627697484524538
10 10
10
29041912218408574