/**
 * This function modifies the elements of a given cross section data at a specific index.
 *
 * @param crossSectionData A list representing the cross section data where each sublist represents a row.
 * @param index The index at which the elements need to be modified.
 * @throws IndexOutOfBoundsException If the index is out of range.
 */
fun modifyElements(crossSectionData: List<MutableList<Float>>, index: Int) {

    // Check if the index is within the range
    if (index >= crossSectionData[0].size) {
        throw IndexOutOfBoundsException("Index out of range")
    }

    // Modify the elements at the given index
    for (row in crossSectionData) {
        // Perform complex calculation to modify each element
        row[index] = row[index] * row[index]
    }

    // Print the modified cross section data
    for (row in crossSectionData) {
        println(row)
    }
}

// Example usage
/**
 * This function modifies the elements of a given cross section data at a specific index.
 *
 * @param crossSectionData A list representing the cross section data where each sublist represents a row.
 * @param index The index at which the elements need to be modified.
 * @throws IndexOutOfBoundsException If the index is out of range.
 */
fun modifyElements(crossSectionData: List<MutableList<Float>>, index: Int) {
/**
 * This function modifies the elements of a given cross section data at a specific index.
 *
 * @param crossSectionData A list representing the cross section data where each sublist represents a row.
 * @param index The index at which the elements need to be modified.
 * @throws IndexOutOfBoundsException If the index is out of range.
 */
fun modifyElements(crossSectionData: List<MutableList<Float>>, index: Int) {

    // Check if the index is within the range
    if (index >= crossSectionData[0].size) {
        throw IndexOutOfBoundsException("Index out of range")
    }

    // Modify the elements at the given index
    for (row in crossSectionData) {
        // Perform complex calculation to modify each element
        row[index] = row[index] * row[index]
    }

    // Print the modified cross section data
    for (row in crossSectionData) {
        println(row)
    }
}

// Example usage