Arithmetic Progression Term

Arithmetic Progression Term

Easy Computer Mathematics Recurrences 28 views
Explanation Complexity

Problem Statement

Given a1,d,n find n-th term.

Input Format

Three integers a1 d n.

Output Format

One integer.

Example

2 3 5
14

Constraints

n>=1

Input / Output Format

Input Format
Three integers a1 d n.
Output Format
One integer.
Constraints
n>=1

Examples

Input:
2 3 5
Output:
14

Example Solution (Public)

Computer Mathematics
Term = a1 + (n-1)*d.

Official Solution Code

Term = a1 + (n-1)*d.
Please login to submit solutions.
Editor
Output

                                        
Please login to submit solutions.