Greatest Common Divisor
Easyjavapythonccppjavascript
Given two positive integers, find their greatest common divisor (GCD).
Input Format
A single line containing two integers A and B.
Output Format
Print the GCD of A and B.
Example 1
Input
48 18
Output
6
Explanation: 6 is the largest number that divides both 48 and 18.
- 1 <= A, B <= 1000000000000000000