Getting TLE in the last test case

Ive used a simple notion of raising every power of primes to product/2 and finally computing the number of factors