Pages

Bangladeshi Blog

Friday, January 14, 2011

8060. Cookies Piles

code:
tc = int(input()) 

while tc: 
    tc -= 1 
    n, a, d = [int(x) for x in raw_input().split()] 
    total = 0 
    while n: 
        n -= 1 
        total += a 
        a += d 

    print total

# end of source code
Be Pythonic

No comments:

Post a Comment