Bored out of your mind on a long car ride, you decide to try out a peculiar single-player game. Upon opening the box, you discover a cardboard circle, divided into
After all the turns have elapsed, your total score is calculated by calculating the sum of values that the token ended on after each turn, meaning that the score of the tile that the token starts on during the first turn is not counted. Can you determine the maximum possible score that you can obtain after playing optimally for
Constraints
For all subtasks,
Subtask 1 [30%]
Subtask 2 [70%]
Input Specification
The first and only line of input will contain the integers
Output Specification
Output, on a single line, the maximum score that can be achieved within
Sample Input
5 5
Sample Output
18
Explanation of Sample Output
The best score you can obtain is by moving to the tiles
Comments