22 lines
361 B
Python
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)
|