Help me in solving NUMFACT problem

My issue

The code won’t stop saying time limit exceeded

My code

t = int(input())
for _ in range(t):
    fact = 2
    n = int(input())
    A = list(map(int,input().split()))
    prod = 1
    for num in A:
        prod = prod * num
    for i in range(2,prod):
        if prod%i==0:
            fact+=1
    print(fact)

Learning course: Number theory
Problem Link: Number of Factors Practice Problem in Introduction to Number theory - CodeChef

@fanghuimeehan
think of some else logic that doesn’t require finding product of all the number .
Hint :- think of something related to the frequency of the prime numbers .