Problem1491--序列

1491: 序列

[Creator : ]
Time Limit : 1.000 sec  Memory Limit : 128 MiB

Description

一个实数列共有n项,已知: ai=(ai-1-ai+1)/2+d  (1<i<n<=20)

Input

键盘输入 n,d,a1,a2,k,(1<=k<=n)

Output

输出ak

Sample Input Copy

10 1 2 2 10

Sample Output Copy

578

Source/Category

admin