python 代码
def divied(x):
i = 2
while i <= x / i:
if x % i == 0:
s = 0
while x % i == 0:
x /= i
s += 1
print(i, s)
i += 1
if x > 1:
print(int(x), 1)
print('')
if __name__ == '__main__':
n = int(input())
for _ in range(n):
a = int(input())
divied(a)