LCC '25 Contest 3 J1 - Snowflakes

View as PDF

Submit solution

Points: 3 (partial)
Time limit: 1.0s
Memory limit: 64M

Author:
Problem type

As winter comes, Bob the penguin notices that ❄️ snowflakes ❄️ come in varying sizes! Interestingly, every snowflake starts out with A sides, and then branches out B times with A sides each!. For example, if a snowflake has 5 sides and branches out 1 time, then each of the initial 5 sides additionally has 5 more sides attached to it!

Input Specification

The first line of input contains two space-separated integers A, B, 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

1 \leq A \leq 75

0 \leq B \leq 4

Sample Input

5 1

Sample Output

30

Sample Explanation

There are 5 initial sides, and each side has 5 more sides attached to them. Therefore, the first level has 5 sides, and the second level has 5 \times 5 sides, which adds to a total of 30 sides.


Comments

There are no comments at the moment.