/**
 * A carpenter needs to calculate the lengths of cuts for a set of wooden beams.
 * The widths and heights of the beams are given as lists.
 *
 * Complete the function to iterate over the nested loops and calculate the required cut lengths
 * for each combination of width and height.
 *
 * @param widths List of integers representing the widths of the wooden beams
 * @param heights List of integers representing the heights of the wooden beams
 * @return A list of tuples, where each tuple contains the width and height of a beam,
 * followed by the calculated cut length for that beam.
 *
 * Example:
 * calculateCutLengths(listOf(2, 3), listOf(4, 5)) => [(2, 4, 8), (2, 5, 10), (3, 4, 12), (3, 5, 15)]
 */
fun calculateCutLengths(widths: List<Int>, heights: List<Int>): List<Triple<Int, Int, Int>> {

    val cutLengths = mutableListOf<Triple<Int, Int, Int>>()

    for (width in widths) {
        for (height in heights) {
            val cutLength = width * height  // Calculate the cut length
            cutLengths.add(Triple(width, height, cutLength))
        }
    }

    return cutLengths
}
/**
 * A carpenter needs to calculate the lengths of cuts for a set of wooden beams.
 * The widths and heights of the beams are given as lists.
 *
 * Complete the function to iterate over the nested loops and calculate the required cut lengths
 * for each combination of width and height.
 *
 * @param widths List of integers representing the widths of the wooden beams
 * @param heights List of integers representing the heights of the wooden beams
 * @return A list of tuples, where each tuple contains the width and height of a beam,
 * followed by the calculated cut length for that beam.
 *
 * Example:
 * calculateCutLengths(listOf(2, 3), listOf(4, 5)) => [(2, 4, 8), (2, 5, 10), (3, 4, 12), (3, 5, 15)]
 */
fun calculateCutLengths(widths: List<Int>, heights: List<Int>): List<Triple<Int, Int, Int>> {
/**
 * A carpenter needs to calculate the lengths of cuts for a set of wooden beams.
 * The widths and heights of the beams are given as lists.
 *
 * Complete the function to iterate over the nested loops and calculate the required cut lengths
 * for each combination of width and height.
 *
 * @param widths List of integers representing the widths of the wooden beams
 * @param heights List of integers representing the heights of the wooden beams
 * @return A list of tuples, where each tuple contains the width and height of a beam,
 * followed by the calculated cut length for that beam.
 *
 * Example:
 * calculateCutLengths(listOf(2, 3), listOf(4, 5)) => [(2, 4, 8), (2, 5, 10), (3, 4, 12), (3, 5, 15)]
 */
fun calculateCutLengths(widths: List<Int>, heights: List<Int>): List<Triple<Int, Int, Int>> {

    val cutLengths = mutableListOf<Triple<Int, Int, Int>>()

    for (width in widths) {
        for (height in heights) {
            val cutLength = width * height  // Calculate the cut length
            cutLengths.add(Triple(width, height, cutLength))
        }
    }

    return cutLengths
}