/**
 * Given a list of window dimensions, return true if all the window widths are divisible
 * by the common factor and false otherwise.
 *
 * @param dimensions A list of window dimensions where each dimension is represented as
 *                   a pair of width and height.
 * @return true if all window widths are divisible by the common factor, false otherwise.
 */
fun checkWindowsDimensions(dimensions: List<Pair<Int, Int>>): Boolean {

    // Find the common factor by calculating the modulus of the first window's width with all
    // other window widths
    var commonFactor = dimensions[0].first
    for (window in dimensions.subList(1, dimensions.size)) {
        commonFactor %= window.first
    }

    // Check if all window widths are divisible by the common factor
    for (window in dimensions) {
        if (window.first % commonFactor != 0) {
            return false
        }
    }

    return true
}
/**
 * Given a list of window dimensions, return true if all the window widths are divisible
 * by the common factor and false otherwise.
 *
 * @param dimensions A list of window dimensions where each dimension is represented as
 *                   a pair of width and height.
 * @return true if all window widths are divisible by the common factor, false otherwise.
 */
fun checkWindowsDimensions(dimensions: List<Pair<Int, Int>>): Boolean {
/**
 * Given a list of window dimensions, return true if all the window widths are divisible
 * by the common factor and false otherwise.
 *
 * @param dimensions A list of window dimensions where each dimension is represented as
 *                   a pair of width and height.
 * @return true if all window widths are divisible by the common factor, false otherwise.
 */
fun checkWindowsDimensions(dimensions: List<Pair<Int, Int>>): Boolean {

    // Find the common factor by calculating the modulus of the first window's width with all
    // other window widths
    var commonFactor = dimensions[0].first
    for (window in dimensions.subList(1, dimensions.size)) {
        commonFactor %= window.first
    }

    // Check if all window widths are divisible by the common factor
    for (window in dimensions) {
        if (window.first % commonFactor != 0) {
            return false
        }
    }

    return true
}