
Willson the Canada Goose is like any other Canada Goose - he now has several goslings (baby geese) to take care of!
Willson has
The goslings are also bored, so they decide to play a game. The goslings will take turns eating all the blades of grass in one patch. However, each gosling must consume a patch with a strictly greater number of blades than the previous gosling. The goslings will take turns in order starting from
However, goslings have different appetites. The
The goslings agree that in the end, each gosling must consume the same number of patches. Thus, the game can only end after gosling
Willson is interested in his children's game and wonders about the maximum total number of blades of grass that can be eaten by the goslings. Can you tell him?
Constraints
Subtask | Percentage | Additional Constraints |
---|---|---|
No additional constraints. |
Input Specification
The first line of input will contain
Output Specification
Output on a single line the maximum total number of blades of grass that can be eaten.
Sample Input
2 6
6
15
Sample Output
16
Explanation for Sample Output
The game could go like this:
- Gosling 1 eats 1 blade
- Gosling 2 eats 4 blades
- Gosling 1 eats 5 blades
- Gosling 2 eats 6 blades
Comments