LCC '25 Contest 3 J1 - Snowflakes
View as PDFAs winter comes, Bob the penguin notices that ❄️ snowflakes ❄️ come in varying sizes! Interestingly, every snowflake starts out with sides, and then branches out
times with
sides each!. For example, if a snowflake has
sides and branches out
time, then each of the initial
sides additionally has
more sides attached to it!
Input Specification
The first line of input contains two space-separated integers ,
, representing the number of initial sides, and the level of branching, respectively.
Output Specification
Output one integer, indicating the total number of resulting sides on the snowflake.
Constraints
Sample Input
5 1
Sample Output
30
Sample Explanation
There are initial sides, and each side has
more sides attached to them. Therefore, the first level has
sides, and the second level has
sides, which adds to a total of
sides.
Comments