408156: GYM103029 C John, Katya, no nuts

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

C. John, Katya, no nutstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

John and Katya are tired of eating nuts. They opened a quiz on Katya's phone, where an answer to the question is a certain non-negative integer.

Each of the two players calls the number and the one which number is closer to the answer wins. Formally, if the correct answer is $$$c$$$ the winner is the one with the minimum value of $$$|x-c|$$$, where $$$x$$$ is someone's answer. If the numbers $$$|x-c|$$$ are equal for both players, then there is no winner.

After a few rounds, John and Katya have relized that the bot that is playing against them will do everything possible to make them win.

John and Katya know that the answer to the question is the number $$$a$$$.

They are wondering if their answer to the question will be $$$b$$$, what is the minimum number that the bot will can output in order for them to win?

Input

Two numbers in single line - $$$0 \le a, b \le 10^9$$$ - real answer to the question, John's and Katya's answer.

Output

The minimum possible non-negative integer that the bot can output. If the bot hasn't option output the number $$$-1$$$.

ExamplesInput
2 6
Output
7
Input
0 9
Output
10
Note

In the first test, if the bot outputs the number $$$7$$$, John and Katya will win, since $$$|7 - 2| > |6 - 2|$$$. It can be shown that no number less than $$$7$$$ can be output by the bot.

加入题单

算法标签: