HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Sections > Unsorted > problem:


GCF

Guest
• Discussion of problem (3)

Section problems

• Tetris 3D
• Meat store
• Bit Decoder
• Knights of the Rook
• Coins
• Primes
• Providers
• A+B
• GCF
• Bfs
• Sign
• Heap
• Timer
• Chess
• Circle
• Herons
• Profits

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