본문 바로가기
Beakjoon&프로그래머스/파이썬

[백준/파이썬] 30143번 Cookie Piles

by 현장 2024. 7. 23.

-Code

for _ in range(int(input())):
    n, a, d = map(int, input().split())

    res = [a]

    for i in range(n - 1):
        res.append(res[-1] + d)

    print(sum(res))