HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Volumes > C. T. 2011 > problem:


GCF

Guest
• Discussion of problem (3)

Volume problems

• A to the power of B
• T-shirts
• GCF
• Maximum Sum
• Making Change
• Best Grass
• Heap
• Bfs
• Chess
• Big Dance
• Binary transformations

Feedback

If you notice incorrect translations in Contester, please let author know.

Time limit 1000/1000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb.

Problem description

Given N positive integers. Write a program that computes the GCD (greatest common divisor) of these numbers.

Input

There is one number N on the first line (0 < n < 1001). On the second line there are N positive integers not bigger than 2*109.

Output

Write the GCD of given numbers .

Example

stdin stdout

5
125 80 67835 1000 90230

5

 

Äëÿ îòïðàâêè ðåøåíèé íåîáõîäèìî âûïîëíèòü âõîä.

www.contester.ru