/**
 * Given a list of lengths and a list of widths, calculate the total cutting length needed by a carpenter.
 *
 * @param lengths a list of integers representing the lengths of the wood pieces
 * @param widths a list of integers representing the widths of the wood pieces
 * @return total cutting length needed
 *
 * Example:
 * lengths = [100, 200, 150]
 * widths = [50, 70, 90]
 * calculateTotalCuttingLength(lengths, widths) -> 1110
 */
fun calculateTotalCuttingLength(lengths: List<Int>, widths: List<Int>): Int {

    var totalCuttingLength = 0

    for (i in lengths.indices) {
        val length = lengths[i]
        val width = widths[i]

        val cuttingLength = 2 * (length + width)

        totalCuttingLength += cuttingLength
    }

    return totalCuttingLength
}
/**
 * Given a list of lengths and a list of widths, calculate the total cutting length needed by a carpenter.
 *
 * @param lengths a list of integers representing the lengths of the wood pieces
 * @param widths a list of integers representing the widths of the wood pieces
 * @return total cutting length needed
 *
 * Example:
 * lengths = [100, 200, 150]
 * widths = [50, 70, 90]
 * calculateTotalCuttingLength(lengths, widths) -> 1110
 */
fun calculateTotalCuttingLength(lengths: List<Int>, widths: List<Int>): Int {
/**
 * Given a list of lengths and a list of widths, calculate the total cutting length needed by a carpenter.
 *
 * @param lengths a list of integers representing the lengths of the wood pieces
 * @param widths a list of integers representing the widths of the wood pieces
 * @return total cutting length needed
 *
 * Example:
 * lengths = [100, 200, 150]
 * widths = [50, 70, 90]
 * calculateTotalCuttingLength(lengths, widths) -> 1110
 */
fun calculateTotalCuttingLength(lengths: List<Int>, widths: List<Int>): Int {

    var totalCuttingLength = 0

    for (i in lengths.indices) {
        val length = lengths[i]
        val width = widths[i]

        val cuttingLength = 2 * (length + width)

        totalCuttingLength += cuttingLength
    }

    return totalCuttingLength
}