from collections import Counter x = 10 ** 6 factor = [[i] for i in range(x + 1)] for i in range(2, x + 1): if len(factor[i]) != 1: continue k = 2 while i * k <= x: value = factor[i * k].pop() while value % i == 0: factor[i * k].append(i) value //= i if value != 1: factor[i * k].append(value) k += 1 def f(x): return x * (x + 1) * (x ** 2 + x + 2) // 8 T = int(input()) def solve(): K = int(input()) if K == 1: print(1) return c = Counter(factor[K]) ans = 1 for p in c.keys(): ans *= f(c[p] + 1) print(ans) for _ in range(T): solve()