for i in range(int(input())): s = 0 for j in range(1, int(input())+1): if j%2: s += int(j) else: s -= int(j) print(f'#{i+1} {s}')