Friday, March 8, 2013

AMR10F SPOJ

http://www.spoj.com/problems/AMR10F/
t=input()
for i in range(t):
    s=raw_input()
    str=s.split(' ')
    n=int(str[0])
    a=int(str[1])
    d=int(str[2])
    ans=n*a+(n-1)*d*n/2
    print ans

No comments:

Post a Comment