/**
 * The Carpenter wants to cut different lengths of wood into smaller pieces 
 * such that each small piece is greater than or equal to a given target length. 
 * The function takes a list of lengths and a target length as input and returns 
 * a list of lengths that can be obtained by cutting the wood. 
 * The lengths in the output list are in ascending order.
 */
fun calculateCuts(lengths: List<Int>, targetLength: Int): List<Int> {

    // Create an empty list to store the valid cuts
    val validCuts = mutableListOf<Int>()

    // Iterate through each length in the given list
    for (length in lengths) {
        if (length >= targetLength) { // Check if the length is greater than or equal to target length
            // The length is valid, add it to the list of valid cuts
            validCuts.add(length)
        }
    }

    // Sort the valid cuts list in ascending order
    validCuts.sort()

    // Return the list of valid cuts
    return validCuts
}
/**
 * The Carpenter wants to cut different lengths of wood into smaller pieces 
 * such that each small piece is greater than or equal to a given target length. 
 * The function takes a list of lengths and a target length as input and returns 
 * a list of lengths that can be obtained by cutting the wood. 
 * The lengths in the output list are in ascending order.
 */
fun calculateCuts(lengths: List<Int>, targetLength: Int): List<Int> {
/**
 * The Carpenter wants to cut different lengths of wood into smaller pieces 
 * such that each small piece is greater than or equal to a given target length. 
 * The function takes a list of lengths and a target length as input and returns 
 * a list of lengths that can be obtained by cutting the wood. 
 * The lengths in the output list are in ascending order.
 */
fun calculateCuts(lengths: List<Int>, targetLength: Int): List<Int> {

    // Create an empty list to store the valid cuts
    val validCuts = mutableListOf<Int>()

    // Iterate through each length in the given list
    for (length in lengths) {
        if (length >= targetLength) { // Check if the length is greater than or equal to target length
            // The length is valid, add it to the list of valid cuts
            validCuts.add(length)
        }
    }

    // Sort the valid cuts list in ascending order
    validCuts.sort()

    // Return the list of valid cuts
    return validCuts
}