# Title: GCD and LCM
# Heading: Python Program to Find the GCD and LCM of Two Numbers
# Level: beginner
# Tags: gcd, lcm, hcf, euclidean algorithm
# About: Finds the greatest common divisor (HCF) of two numbers with Euclid's algorithm, then their least common multiple from it.

def gcd(a, b):
    """The greatest common divisor of a and b."""
    while b != 0:
        a, b = b, a % b
    return a


def lcm(a, b):
    """The least common multiple of a and b."""
    return a * b // gcd(a, b)


print("GCD of 48 and 18:", gcd(48, 18))
print("LCM of 48 and 18:", lcm(48, 18))
