Let an,bn,cn be arithmetic progressions. It is known that
a1+b1+c1=p,
a2+b2+c2=q
For the given positive integer k find the value of ak+bk+ck.
Three integers p,q (∣p∣,∣q∣≤1018),k (k>0).
Print the value of ak+bk+ck. It is known that output is no more than 1018 by absolute value.