favorite We need a little bit of your help to keep things running, click on this banner to learn more

Marathon weekend with restrictions


prb1113The castle consists of K levels. Each level - this is the correct N-gon, the angle of which coincides with the angle of the previous (the structure of the castle for example, input data is shown in the figure). On the sides of the first level are two rooms on each side of the next - one more. How many rooms in the castle?


In a single line of input file specifies two integers NandK (3N106, 1K106).


Bring out a single number - the number of rooms in the castle.

Time limit 1 second
Memory limit 64 MiB
Input example #1
6 3
Output example #1
Source Stage II All-Ukrainian Olympiad 2010-2011 Berdichev