/**
 * A historian wants to calculate the sum of all numbers from 1 to n
 * that are multiples of m.
 *
 * Complete the code below to solve the exercise.
 */
fun sumOfMultiples(n: Int, m: Int): Int {

    // Initialize the sum variable
    var totalSum = 0

    // Iterate through the numbers from 1 to n
    for (num in 1..n) {
        // Check if the number is a multiple of m
        if (num % m == 0) {
            // Update the sum variable
            totalSum += num
        }
    }

    // Return the sum of the multiples of m
    return totalSum
}
/**
 * A historian wants to calculate the sum of all numbers from 1 to n
 * that are multiples of m.
 *
 * Complete the code below to solve the exercise.
 */
fun sumOfMultiples(n: Int, m: Int): Int {
/**
 * A historian wants to calculate the sum of all numbers from 1 to n
 * that are multiples of m.
 *
 * Complete the code below to solve the exercise.
 */
fun sumOfMultiples(n: Int, m: Int): Int {

    // Initialize the sum variable
    var totalSum = 0

    // Iterate through the numbers from 1 to n
    for (num in 1..n) {
        // Check if the number is a multiple of m
        if (num % m == 0) {
            // Update the sum variable
            totalSum += num
        }
    }

    // Return the sum of the multiples of m
    return totalSum
}