/**
 * Given the dimensions of a board (width and length),
 * determine the number of cuts needed to split the board
 * into square pieces of maximum size possible.
 *
 * @param width The width of the board.
 * @param length The length of the board.
 * @return The total number of cuts needed to split the board.
 */
fun calculateCuts(width: Int, length: Int): Int {

    if (width == 0 || length == 0) {
        return 0
    }

    var cuts = 0
    var boardWidth = width
    var boardLength = length

    while (boardWidth > 0 && boardLength > 0) {
        if (boardWidth == boardLength) {
            cuts++
            break
        }

        if (boardWidth > boardLength) {
            boardWidth -= boardLength
        } else {
            boardLength -= boardWidth
        }
        cuts++
    }

    return cuts
}
/**
 * Given the dimensions of a board (width and length),
 * determine the number of cuts needed to split the board
 * into square pieces of maximum size possible.
 *
 * @param width The width of the board.
 * @param length The length of the board.
 * @return The total number of cuts needed to split the board.
 */
fun calculateCuts(width: Int, length: Int): Int {
/**
 * Given the dimensions of a board (width and length),
 * determine the number of cuts needed to split the board
 * into square pieces of maximum size possible.
 *
 * @param width The width of the board.
 * @param length The length of the board.
 * @return The total number of cuts needed to split the board.
 */
fun calculateCuts(width: Int, length: Int): Int {

    if (width == 0 || length == 0) {
        return 0
    }

    var cuts = 0
    var boardWidth = width
    var boardLength = length

    while (boardWidth > 0 && boardLength > 0) {
        if (boardWidth == boardLength) {
            cuts++
            break
        }

        if (boardWidth > boardLength) {
            boardWidth -= boardLength
        } else {
            boardLength -= boardWidth
        }
        cuts++
    }

    return cuts
}