/**
 * A carpenter wants to calculate how many cuts of a certain length can be made from various board lengths.
 * The function takes a list of board lengths and a cut length as input and returns a list with the number of cuts that
 * can be made from each board length. However, the carpenter wants to stop the calculations once a board length is too
 * short to make any more cuts of the given length.
 *
 * @param boardLengths List<Int>: A list of integers representing the lengths of the boards.
 * @param cutLength Int: The length of each desired cut.
 * @return List<Int>: A list with the number of cuts that can be made from each board length before they get too short.
 */
fun calculateCuts(boardLengths: List<Int>, cutLength: Int): List<Int> {

    val cuts = mutableListOf<Int>()
    for (length in boardLengths) {
        var remainingLength = length
        var numCuts = 0

        while (remainingLength >= cutLength) {
            remainingLength -= cutLength
            numCuts++
        }

        cuts.add(numCuts)

        if (remainingLength < cutLength) {
            break
        }
    }

    return cuts
}
/**
 * A carpenter wants to calculate how many cuts of a certain length can be made from various board lengths.
 * The function takes a list of board lengths and a cut length as input and returns a list with the number of cuts that
 * can be made from each board length. However, the carpenter wants to stop the calculations once a board length is too
 * short to make any more cuts of the given length.
 *
 * @param boardLengths List<Int>: A list of integers representing the lengths of the boards.
 * @param cutLength Int: The length of each desired cut.
 * @return List<Int>: A list with the number of cuts that can be made from each board length before they get too short.
 */
fun calculateCuts(boardLengths: List<Int>, cutLength: Int): List<Int> {
/**
 * A carpenter wants to calculate how many cuts of a certain length can be made from various board lengths.
 * The function takes a list of board lengths and a cut length as input and returns a list with the number of cuts that
 * can be made from each board length. However, the carpenter wants to stop the calculations once a board length is too
 * short to make any more cuts of the given length.
 *
 * @param boardLengths List<Int>: A list of integers representing the lengths of the boards.
 * @param cutLength Int: The length of each desired cut.
 * @return List<Int>: A list with the number of cuts that can be made from each board length before they get too short.
 */
fun calculateCuts(boardLengths: List<Int>, cutLength: Int): List<Int> {

    val cuts = mutableListOf<Int>()
    for (length in boardLengths) {
        var remainingLength = length
        var numCuts = 0

        while (remainingLength >= cutLength) {
            remainingLength -= cutLength
            numCuts++
        }

        cuts.add(numCuts)

        if (remainingLength < cutLength) {
            break
        }
    }

    return cuts
}