728x90
반응형
단순 수학 문제이다.
for i in range(int(input())):
a, b = map(int, input().split())
res = (b-a+1) * (a+b)//2
print(f"Scenario #{i+1}:")
print(f"{res}\n")
728x90
반응형
'Agorithm > 백준 알고리즘' 카테고리의 다른 글
백준 알고리즘 7598번 Bookings(python) (0) | 2021.02.18 |
---|---|
백준 알고리즘 7581번 Cuboids(python) (0) | 2021.02.18 |
백준 알고리즘 7510번 고급 수학(python) (0) | 2021.02.18 |
백준 알고리즘 7015번 Millennium(python) (0) | 2021.02.18 |
백준 알고리즘 6975번 Deficient, Perfect, and Abundant(python) (0) | 2021.02.18 |