No.2088 Number Guessing Game
Note
After the contest ended, the input format was changed to use KaTeX. In addition, because there was a bug where the judge would return J_TLE if the output contained too many characters, a constraint on the number of output characters was added.
Problem Statement
You are given integers $A,B$ as input.
A number guessing game is a game in which you try to guess the number that the other player is thinking of.
As you know, the Number-Guessing-Game-Loving bot is a bot that loves number guessing games.
Play a number guessing game with the Number-Guessing-Game-Loving bot and answer correctly.
By the way, the Number-Guessing-Game-Loving bot is a cheater, so it does not have one fixed number in mind until you answer.
Surprisingly, it listens to your answer and then changes the correct number accordingly!
Specifically, it seems to think of the integer obtained by multiplying the value you answered by $A$ and adding $B$.
Input
The input is given from standard input in the following format:
$A$ $B$
Constraints
The input $A,B$ satisfies the following constraints:
- $A$ is an integer with absolute value at most $10^{18}$
- $B$ is an integer with absolute value at most $10^{18}$
- There exists a correct answer in the number guessing game with the Number-Guessing-Game-Loving bot
Output
Output, on $1$ line, a correct answer in the number guessing game with the Number-Guessing-Game-Loving bot.
However, outputting anything other than an integer results in WA.
For example, even if you fight cheating with cheating, an eye for an eye, and output 数当てゲーム大好きbotが思い浮かべている数, it is WA.
Note that there may be more than one correct answer, but output only one of them.
Also, due to judging constraints, the output must be at most $100$ characters.
Print a newline at the end.
Sample
Sample 1
Input
1 0
Output
5000000000000000
Suppose you answer $5000000000000000$. The integer obtained by multiplying that value by $A = 1$ and adding $B = 0$ is also $5000000000000000$, so you have indeed output a correct answer.
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。