/**
 * Given a list of grades and a target grade, modify the elements of the list
 * by multiplying each element greater than the target by 2 and each element
 * less than or equal to the target by 0.5.
 *
 * @param grades A list of grades.
 * @param target The target grade.
 * @return The modified list of grades.
 */
fun modifyElements(grades: MutableList<Double>, target: Double): List<Double> {

    // Iterate over the list using indices and modify the elements
    for (i in grades.indices) {
        if (grades[i] > target) {
            grades[i] *= 2
        } else {
            grades[i] *= 0.5
        }
    }
    return grades
}
/**
 * Given a list of grades and a target grade, modify the elements of the list
 * by multiplying each element greater than the target by 2 and each element
 * less than or equal to the target by 0.5.
 *
 * @param grades A list of grades.
 * @param target The target grade.
 * @return The modified list of grades.
 */
fun modifyElements(grades: MutableList<Double>, target: Double): List<Double> {
/**
 * Given a list of grades and a target grade, modify the elements of the list
 * by multiplying each element greater than the target by 2 and each element
 * less than or equal to the target by 0.5.
 *
 * @param grades A list of grades.
 * @param target The target grade.
 * @return The modified list of grades.
 */
fun modifyElements(grades: MutableList<Double>, target: Double): List<Double> {

    // Iterate over the list using indices and modify the elements
    for (i in grades.indices) {
        if (grades[i] > target) {
            grades[i] *= 2
        } else {
            grades[i] *= 0.5
        }
    }
    return grades
}