/**
 * This function calculates the highest common divisor (HCD) of two positive integers.
 * The HCD is the largest integer that evenly divides both integers without any remainder.
 */
fun commonDivisor(x: Int, y: Int): Int {

    // Initialize the greater and smaller integers
    val greater: Int
    val smaller: Int
    if (x > y) {
        greater = x
        smaller = y
    } else {
        greater = y
        smaller = x
    }

    // Check if the smaller integer is 0
    if (smaller == 0) {
        return greater
    }

    // Find the remainder
    val remainder = greater % smaller

    // Refine the values of greater and smaller
    return commonDivisor(smaller, remainder)
}
/**
 * This function calculates the highest common divisor (HCD) of two positive integers.
 * The HCD is the largest integer that evenly divides both integers without any remainder.
 */
fun commonDivisor(x: Int, y: Int): Int {
/**
 * This function calculates the highest common divisor (HCD) of two positive integers.
 * The HCD is the largest integer that evenly divides both integers without any remainder.
 */
fun commonDivisor(x: Int, y: Int): Int {

    // Initialize the greater and smaller integers
    val greater: Int
    val smaller: Int
    if (x > y) {
        greater = x
        smaller = y
    } else {
        greater = y
        smaller = x
    }

    // Check if the smaller integer is 0
    if (smaller == 0) {
        return greater
    }

    // Find the remainder
    val remainder = greater % smaller

    // Refine the values of greater and smaller
    return commonDivisor(smaller, remainder)
}