Submit | All submissions | Best solutions | Back to list |
ENGCD - Greatest Common Divisor |
Given two integers x, y calculates the greatest common divisor (gcd).
In mathematics, the greatest common divisor (gcd) of two or more integers, which are not all zero, is the largest positive integer that divides each of the integers. For example, the gcd of 8 and 12 is 4
Input
Two integers x and y other than 0.
Output
The greatest common divisor (gcd) of x and y.
Example
Input: 8
12 Output: 4
Added by: | giorgio.piccardo |
Date: | 2018-10-03 |
Time limit: | 1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | NCSHARP JULIA PYPY3 PYTHON3 |