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

[백준/파이썬]9299번 Math Tutoring

by 현장 2021. 4. 14.

-코드

t = int(input())

for i in range(t):
    n = list(map(int, input().split()))
    a = [n[0] - 1]
    for j in range(n[0]):
        a.append((n[0] - j) * n[j + 1])

    print(f"Case {i + 1}:", *a)