Execution time limit is 1 second Runtime memory usage limit is 128 megabytes The integers a, b, c are given. Implement the recursive function:
f(n)={a,n=0f(n−1)+bn+c,n>0
Input
Four integers a,b,c(∣a∣,∣b∣,∣c∣≤1000),n(0≤n≤1000).
Output
Print the value of f(n).
Examples