Recursive GCD
Given two integers
a
and b
, write a recursive function to calculate the greatest common divisor (GCD) of a
and b
. Input
The input contains two integers separated by a space
a
and b
(1 β€ a, b β€ ). Output
The program should print the GCD of
a
and b
. Examples
Input | Output |
8 12 | 4 |
5 25 | 5 |
7 13 | 1 |
Β
Constraints
Time limit: 1 seconds
Memory limit: 512 MB
Output limit: 1 MB