Maximum GCD of all pairs

I was thinking of problem : http://www.codechef.com/problems/BYTES4

Given N integers, output the maximum value of GCD for all the pairs possible.
How to approach this question?
Please Help.

@gorv editorial posted .

http://discuss.codechef.com/questions/38022/editorial-bytes4-todo-en-uno [GCD,Seive]

//