WA in RECIPE

I am getting WA for the problem link:
[RECIPE Problem - CodeChef][1]

and here is my solution id [link][2]

Please help me with the problem

Thank you
[1]: RECIPE Problem - CodeChef
[2]: CodeChef: Practical coding for everyone

" if(new_gcd != gcd){ flag =1; break; } " this statement is the bug in your code.
consider the test case
1
4 8 16 4 2
apart from that statement every thing is correct. i removed that statement and got accepted.
accepted solution CodeChef: Practical coding for everyone