#K79427. Cumulative Skill Calculation

    ID: 35306 Type: Default 1000ms 256MiB

Cumulative Skill Calculation

Cumulative Skill Calculation

You are given an initial skill level S, a daily percentage increase p, and a number of training days n. Each day, the trainee's skill increases based on the current level. Specifically, on each training day, the trainee's current skill is added to the cumulative sum, and then the skill is updated using the following formula:

$$S_{i+1}=\lfloor S_i \times \Bigl(1+\frac{p}{100}\Bigr) \rfloor$$

Here, \(S_i\) is the skill level at the beginning of day \(i\) (with \(S_0 = S\)), and \(\lfloor \cdot \rfloor\) denotes the floor function (i.e. rounding down to the nearest integer). The cumulative skill after \(n\) days is given by:

$$C = \sum_{i=0}^{n-1} S_i$$

Your task is to calculate and output the cumulative skill \(C\) after \(n\) training days.

Examples:

  • Input: 10 20 3 → Output: 36
  • Input: 5 10 0 → Output: 0
  • Input: 10 20 1 → Output: 10

inputFormat

The input consists of a single line containing three space-separated integers:

  • S – the initial skill level.
  • p – the daily percentage increase.
  • n – the number of training days.

outputFormat

Output a single integer representing the cumulative skill level after n days of training.

## sample
10 20 3
36