#CCBCHBA0000058. Bậc thang tiền tiết kiệm (Regular Savings)

Bậc thang tiền tiết kiệm (Regular Savings)

Regular Savings

Source: Phước Hưng OJ

Version: Phuoc Hung OJ Extended

Problem Statement

You start with x units of money. At the end of each of n periods, you add exactly c units. There is no interest or withdrawal. Print the final balance; when n=0, it remains x.

Input

One line: integers x, c, n in this order; 0<=x<=10^6, 0<=c<=10^4, 0<=n<=1000.

Output

One integer: the balance after exactly n periods.

Subtasks

  • Subtask 1 (20%): x≤100,c≤10,n≤5x\le100,c\le10,n\le5.
  • Subtask 2 (30%): x≤104,c≤103,n≤100x\le10^4,c\le10^3,n\le100.
  • Subtask 3 (50%): x≤106,c≤104,n≤1000x\le10^6,c\le10^4,n\le1000.

Examples

Example 1

Input:

100 25 3

Output:

175

Explanation:

Three deposits give 100, 125, 150, then 175.

Example 2

Input:

123 50 0

Output:

123

Explanation:

Zero periods means no addition.