Greatest common divisor

Write a program that computes the greatest common divisor of two numbers.

Input

Input consists of two strictly positive natural numbers aa and bb.

Output

Print the greatest common divisor of aa and bb.

Observation

Although the solution to this exercise does not need to be very efficient, it should not be too slow.

Problem information

Author: Unknown
Translator: Carlos Molina

Generation: 2026-01-25T11:33:17.203Z

© Jutge.org, 2006–2026.
https://jutge.org