Hey can someone tell me , why codechef is not accepting my code??
The right approach and the easiest one that I can think of is to find the GCD of all the numbers and divide all the numbers of the array by that GCD
The resultant array will be your answer.
This link might help you : GCD of an Array