/**
 * This function takes a list of widths and heights of rectangles and calculates their areas.
 * The function uses a while loop to iterate through the list and calculate the areas one by one.
 * The areas are then returned as a list.
 *
 * @param widths A list of integers representing the widths of rectangles.
 * @param heights A list of integers representing the heights of rectangles.
 * @return A list of integers representing the areas of rectangles.
 *
 * Example:
 * calcRectanglesAreas(listOf(2, 3, 4), listOf(5, 6, 7)) returns [10, 18, 28]
 */
fun calcRectanglesAreas(widths: List<Int>, heights: List<Int>): List<Int> {

    val areas = mutableListOf<Int>()  // Initialize an empty list to store the areas
    var i = 0  // Initialize the index variable

    while (i < widths.size) {  // Loop until the index reaches the end of the list
        val area = widths[i] * heights[i]  // Calculate the area of the current rectangle
        areas.add(area)  // Append the area to the list of areas
        i++  // Increment the index by 1
    }

    return areas
}
/**
 * This function takes a list of widths and heights of rectangles and calculates their areas.
 * The function uses a while loop to iterate through the list and calculate the areas one by one.
 * The areas are then returned as a list.
 *
 * @param widths A list of integers representing the widths of rectangles.
 * @param heights A list of integers representing the heights of rectangles.
 * @return A list of integers representing the areas of rectangles.
 *
 * Example:
 * calcRectanglesAreas(listOf(2, 3, 4), listOf(5, 6, 7)) returns [10, 18, 28]
 */
fun calcRectanglesAreas(widths: List<Int>, heights: List<Int>): List<Int> {
/**
 * This function takes a list of widths and heights of rectangles and calculates their areas.
 * The function uses a while loop to iterate through the list and calculate the areas one by one.
 * The areas are then returned as a list.
 *
 * @param widths A list of integers representing the widths of rectangles.
 * @param heights A list of integers representing the heights of rectangles.
 * @return A list of integers representing the areas of rectangles.
 *
 * Example:
 * calcRectanglesAreas(listOf(2, 3, 4), listOf(5, 6, 7)) returns [10, 18, 28]
 */
fun calcRectanglesAreas(widths: List<Int>, heights: List<Int>): List<Int> {

    val areas = mutableListOf<Int>()  // Initialize an empty list to store the areas
    var i = 0  // Initialize the index variable

    while (i < widths.size) {  // Loop until the index reaches the end of the list
        val area = widths[i] * heights[i]  // Calculate the area of the current rectangle
        areas.add(area)  // Append the area to the list of areas
        i++  // Increment the index by 1
    }

    return areas
}