問題一覧 > 教育的問題

No.2088 Number Guessing Game

レベル : / AI推定難易度 : 189 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / スペシャルジャッジ問題 (複数の解が存在する可能性があります)
タグ : (AC するまで非表示) / 解いたユーザー数 144
作問者 : 👑 p-adic / テスター : 👑 qand
お気に入りにしたユーザー ProblemId : 8407 / 自分の提出
問題文最終更新日: 2022-09-30 23:22:30
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
yukicoder contest 362 (順位表) の他の問題:

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もしくは右上の雲マークをクリックしてアカウントを作成してください。