scientific_comp_projects/CODE/[python]kattis/trivial/chanukah_challenge.py
2021-10-29 15:16:40 +02:00

22 lines
361 B
Python

p = int(input())
def candles(n):
if n == 1:
return 2
else :
return n + 1 + candles(n-1)
cases = []
for i in range(p):
data = input()
_ , n = data.split(' ')
candles = 0
for j in range(int(n)):
candles = 2 + j + candles
cases.append(str(i+1) +' '+ str(candles))
for case in cases:
print(case)