408514: GYM103176 G Guessing Game
Description
Wukong, Xayah and Yasuo invite you to play a guessing game.
Wukong will first draw a random positive integer $$$W$$$ between $$$1$$$ and $$$100$$$, including $$$1$$$ and $$$100$$$. Each number will be drawn with the same probability, i.e. $$$1\%$$$.
Xayah, Yasuo, and you each have to guess a different number between $$$1$$$ and $$$100$$$. A player's goal is to minimize the difference between his/her own number and Wukong's hidden number $$$W$$$. In other words, the one with the number closest to $$$W$$$ wins. In case more than one player has the minimum difference, no one wins.
Xayah is the first player to guess, and she guessed $$$X$$$. Yasuo is the next player, and he guessed $$$Y$$$ ($$$X\neq Y$$$). Now it is your turn, given the numbers $$$X$$$ and $$$Y$$$ Xayah and Yasuo guessed, you should guess a number $$$Z$$$ that is different from $$$X$$$ and $$$Y$$$, and also maximize the chance of winning the game.
For example, if the hidden number $$$W=50$$$, and the guesses are $$$X=20, Y=81, Z=79$$$. Then you win as $$$Z$$$ is the closest number to $$$W$$$ (as $$$|W-Z|=29$$$ is smaller than $$$|W-X|=30$$$ and $$$|W-Y|=31$$$). If the hidden number $$$W=80$$$, then no one wins, as $$$|W-Z|$$$ and $$$|W-Y|$$$ are both equal to $$$1$$$ which is less than $$$|W-X|=60$$$.
InputThe only line contains two integers $$$X$$$ and $$$Y$$$ ($$$1\le X, Y\le 100$$$, $$$X\neq Y$$$).
OutputA single integer $$$Z$$$, which is your guess. If there are more than one possible values that can maximize the chance of winning, please output any one of them.
ExampleInput20 81Output
79