Maximum of GCD of N numbers

Revision en1, by ScienceGuy, 2017-07-23 23:45:58

What is the efficient algorithm to find the maximum Greatest Common Divisor of N numbers? Input: First line contains N (2<=N<=10^5). Next line contains N numbers, each of them more than 1 and less than 10^5, output: Output the largest GCD of any pair of numbers.

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English ScienceGuy 2017-07-23 23:45:58 294 Initial revision (published)