Let's Eat, Kevin!
Congrats guys, we did it! We killed Kevin! Now it's time to feast on him.
Chef Oree is preparing the delicacy of Kevin the Watermelon. Kevin is modelled as a 2D circular watermelon slice. Mathematically, his flesh is a filled circle, also called a disk.
To safely prepare and cook him, Oree needs to perform a precise culinary execution. He will need to make distinct, infinitely long straight cuts right through Kevin's red flesh.
However, preparing Kevin is difficult; one mistake and it's fatal for the eater, where Kevin's venomous heart lies at its exact geometric centre.
- To properly neutralise the Kevin toxin, exactly
cuts must perfectly pierce the centre.
- The remaining
cuts must avoid the centre, slicing only the surrounding flesh.
Assuming Oree can freely choose the angles and positions of all his cuts as long as he strictly follows the execution rules above, what is the maximum number of pieces of flesh he can carve from Kevin?
Input
The input contains two integers in a single line and
(
), where
is the total number of cuts, and exactly
cuts must pass through the centre of Kevin.
Output
Print one integer: the maximum possible number of distinct pieces of flesh.
Example
Input 1
1 0
Output 1
2
A single cut through Kevin, avoiding the heart, divides into exactly pieces.
Input 2
3 3
Output 2
6
All cuts must pierce the centre. As all cuts intersect at the exact same point, Oree cannot generate extra intersections in the outer flesh, leaving 6 sectors of meat!
Comments