Primes and Multiplication

CodeForces - 1228C