/**
 * This exercise requires the librarian to append a new element to a list of numbers,
 * and then multiply each element in the list by a given number.
 *
 * @param numbersList A list of numbers.
 * @param num The new element to append to the list.
 * @param multiplier The number to multiply each element in the list by.
 * @return The modified list with the new element appended and each element multiplied.
 */
fun appendAndMultiply(numbersList: MutableList<Int>, num: Int, multiplier: Int): List<Int> {

    // Append the new element to the list
    numbersList.add(num)

    // Multiply each element in the list by the given multiplier
    val multipliedList = numbersList.map { it * multiplier }

    return multipliedList
}

// Example usage
/**
 * This exercise requires the librarian to append a new element to a list of numbers,
 * and then multiply each element in the list by a given number.
 *
 * @param numbersList A list of numbers.
 * @param num The new element to append to the list.
 * @param multiplier The number to multiply each element in the list by.
 * @return The modified list with the new element appended and each element multiplied.
 */
fun appendAndMultiply(numbersList: MutableList<Int>, num: Int, multiplier: Int): List<Int> {
/**
 * This exercise requires the librarian to append a new element to a list of numbers,
 * and then multiply each element in the list by a given number.
 *
 * @param numbersList A list of numbers.
 * @param num The new element to append to the list.
 * @param multiplier The number to multiply each element in the list by.
 * @return The modified list with the new element appended and each element multiplied.
 */
fun appendAndMultiply(numbersList: MutableList<Int>, num: Int, multiplier: Int): List<Int> {

    // Append the new element to the list
    numbersList.add(num)

    // Multiply each element in the list by the given multiplier
    val multipliedList = numbersList.map { it * multiplier }

    return multipliedList
}

// Example usage