/**
 * Given the starting and ending distances of two roads, calculate the total length of the roads
 * by summing the distance at each 100-meter interval.
 *
 * @param d1 Starting distance of the first road in meters
 * @param d2 Ending distance of the second road in meters
 * @return Total length of the roads in meters
 *
 * Example:
 * calculateTotalLength(0, 2000) -> 2000
 * calculateTotalLength(1000, 3000) -> 4000
 */
fun calculateTotalLength(d1: Int, d2: Int): Int {

    var totalLength = 0

    // Loop through the range from d1+100 to d2 (inclusive), incrementing by 100
    for (distance in (d1 + 100)..d2 step 100) {
        totalLength += distance
    }

    return totalLength
}
/**
 * Given the starting and ending distances of two roads, calculate the total length of the roads
 * by summing the distance at each 100-meter interval.
 *
 * @param d1 Starting distance of the first road in meters
 * @param d2 Ending distance of the second road in meters
 * @return Total length of the roads in meters
 *
 * Example:
 * calculateTotalLength(0, 2000) -> 2000
 * calculateTotalLength(1000, 3000) -> 4000
 */
fun calculateTotalLength(d1: Int, d2: Int): Int {
/**
 * Given the starting and ending distances of two roads, calculate the total length of the roads
 * by summing the distance at each 100-meter interval.
 *
 * @param d1 Starting distance of the first road in meters
 * @param d2 Ending distance of the second road in meters
 * @return Total length of the roads in meters
 *
 * Example:
 * calculateTotalLength(0, 2000) -> 2000
 * calculateTotalLength(1000, 3000) -> 4000
 */
fun calculateTotalLength(d1: Int, d2: Int): Int {

    var totalLength = 0

    // Loop through the range from d1+100 to d2 (inclusive), incrementing by 100
    for (distance in (d1 + 100)..d2 step 100) {
        totalLength += distance
    }

    return totalLength
}