logo AlgoBeat OnlineJudge
登录 注册

#215999. [TOPC 2021] Eatcoin

内存限制:512 MiB 时间限制:3000 ms 标准输入输出
题目类型:VJudge(洛谷) 评测方式:VJudge
上传者: 匿名

题目描述

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.

样例

样例输入 1

50 1

样例输出 1

117
42627697484524538

样例输入 2

10 10

样例输出 2

10
29041912218408574

数据范围与提示