#P5137. Modified Binomial Sum

    ID: 18375 Type: Default 1000ms 256MiB

Modified Binomial Sum

Modified Binomial Sum

Wolfycz loves studying polynomials, especially the expansion \((a+b)^n = \sum_{i=0}^{n} \binom{n}{i}a^i b^{n-i}\). Dissatisfied with the binomial coefficients, he replaced all coefficients with 1, resulting in the sum \(\sum_{i=0}^{n} a^i b^{n-i}\). Your task is to compute this sum efficiently for given values of \(a\), \(b\), and \(n\).

Note: Constant factors can affect the running efficiency of your program.

inputFormat

The input consists of a single line containing three integers \(a\), \(b\), and \(n\), where \(n\) is a non-negative integer.

outputFormat

Output a single integer: the value of \(\sum_{i=0}^{n} a^i b^{n-i}\).

sample

2 3 2
19