m = int(input())
def f(N):
if N == 0:
print(0)
return
elif N > 0:
print(int(3*N/2*(N+1)))
return
else:
print(int(3*N/2*(-N+1)))
return
for _ in range(m):
N = int(input().strip())
f(N)
KY241 整数和
最新推荐文章于 2024-11-03 20:27:08 发布