Company: Morgan stanley_21feb
Difficulty: medium
Prime Factor Decryption Problem Description A network security company encrypts and decrypts sensitive data for various organisations. The team is automating its decryption pipeline, and it holds a list of N numbers in an encrypted format. To decrypt the data, the automation first multiplies all N numbers together. It then represents that single product as a product of prime numbers. Finally, it reports only the distinct primes that appear in that representation - these primes are the decrypted message. Write an algorithm that reports the decrypted message. Input Format The first line of input consists of an integer data_size , representing the number of pieces of encrypted data in the list (N). The second line consists of N space-separated integers representing the encrypted data. Output Format Print the distinct prime factors of the product of all N input numbers, in ascending order, on a single line, separated by single spaces. Constraints 1 <= data_size <= 50 (inferred - the