/**
 * The Carpenter wants to cut a piece of wood into several equal-length segments.
 * He decided to use slicing to modify the wood piece.
 * Write a function that takes the original length of the wood and the number of cuts as input
 * and returns the final lengths of the wood segments after performing the cuts.
 *
 * @param woodLength The original length of the wood piece.
 * @param cuts The number of cuts to be made on the wood.
 * @return A list of equal-length segments of the wood after performing the cuts.
 */
fun cutWood(woodLength: Double, cuts: Int): List<Double> {

    val segmentLength = woodLength / (cuts + 1)
    val segments = MutableList(cuts) { segmentLength }
    val totalLength = woodLength - (segmentLength * cuts)
    segments.add(0, woodLength - totalLength)
    return segments
}
/**
 * The Carpenter wants to cut a piece of wood into several equal-length segments.
 * He decided to use slicing to modify the wood piece.
 * Write a function that takes the original length of the wood and the number of cuts as input
 * and returns the final lengths of the wood segments after performing the cuts.
 *
 * @param woodLength The original length of the wood piece.
 * @param cuts The number of cuts to be made on the wood.
 * @return A list of equal-length segments of the wood after performing the cuts.
 */
fun cutWood(woodLength: Double, cuts: Int): List<Double> {
/**
 * The Carpenter wants to cut a piece of wood into several equal-length segments.
 * He decided to use slicing to modify the wood piece.
 * Write a function that takes the original length of the wood and the number of cuts as input
 * and returns the final lengths of the wood segments after performing the cuts.
 *
 * @param woodLength The original length of the wood piece.
 * @param cuts The number of cuts to be made on the wood.
 * @return A list of equal-length segments of the wood after performing the cuts.
 */
fun cutWood(woodLength: Double, cuts: Int): List<Double> {

    val segmentLength = woodLength / (cuts + 1)
    val segments = MutableList(cuts) { segmentLength }
    val totalLength = woodLength - (segmentLength * cuts)
    segments.add(0, woodLength - totalLength)
    return segments
}