#C2915. Compute the Greatest Common Divisor
Compute the Greatest Common Divisor
Compute the Greatest Common Divisor
Given two integers \(A\) and \(B\), compute their greatest common divisor (GCD) using the Euclidean algorithm. The GCD of two integers is the largest positive integer that divides both numbers without leaving a remainder. The classical algorithm works by repeatedly setting \(A = B\) and \(B = A \% B\) until \(B\) becomes 0. The value of \(A\) at that stage is the GCD.
Example:
Input: 15 25 Output: 5
Note: Use the input from standard input (stdin) and print the result to standard output (stdout).
inputFormat
The input consists of a single line containing two integers \(A\) and \(B\) separated by space. \(A\) and \(B\) may be large (up to 105 or more).
outputFormat
Print a single integer which is the greatest common divisor of \(A\) and \(B\).
## sample15 25
5