Link to the question :https://www.spoj.com/problems/FACTCG2/
Link to code : https://ideone.com/4JlHQE
My approach : I basically created a vector Primes where I stored least prime factor of every number . Then for each input , I divide it by its least prime factor and then display the factors . But Judge gives me wrong answer .