#Z0004. 等差数列

    ID: 938 Type: Default 1000ms 256MiB Tried: 4 Accepted: 3 Difficulty: 10 Uploaded By: Tags>入门-编程基础之输入输出

等差数列

题目描述

给出n个整数a1,a2,a3...,an,如果对于任意的i(2<=i<=n),ai-a(i-1)都相等,称这列数为“等差数列”。现在给出一个等差数列的前两项a1,a2,求第n项的值为多少?

输入格式

一行三个整数a1,a2和n,之间用一个空格隔开。其中,,-100<=a1,a2<=100,1<=n<=1000.

输出格式

一行一个整数,即第n项的值

1 4 100
298