/**
 * A musician wants to calculate the tempo of a musical piece given the number of beats and its duration.
 * The duration is represented as a pair in the format (minutes, seconds).
 * The musician wants to calculate the tempo in beats per minute (BPM).
 *
 * Complete the code below to calculate and return the tempo in BPM using the provided beats and duration.
 *
 * @param beats The number of beats in the musical piece.
 * @param duration The duration of the musical piece in the format (minutes, seconds).
 * @return The tempo of the musical piece in beats per minute (BPM).
 */
fun calculateTempo(beats: Int, duration: Pair<Int, Int>): Double {

    val totalSeconds = duration.first * 60 + duration.second
    val tempo = beats.toDouble() / (totalSeconds / 60.0)
    return tempo
}
/**
 * A musician wants to calculate the tempo of a musical piece given the number of beats and its duration.
 * The duration is represented as a pair in the format (minutes, seconds).
 * The musician wants to calculate the tempo in beats per minute (BPM).
 *
 * Complete the code below to calculate and return the tempo in BPM using the provided beats and duration.
 *
 * @param beats The number of beats in the musical piece.
 * @param duration The duration of the musical piece in the format (minutes, seconds).
 * @return The tempo of the musical piece in beats per minute (BPM).
 */
fun calculateTempo(beats: Int, duration: Pair<Int, Int>): Double {
/**
 * A musician wants to calculate the tempo of a musical piece given the number of beats and its duration.
 * The duration is represented as a pair in the format (minutes, seconds).
 * The musician wants to calculate the tempo in beats per minute (BPM).
 *
 * Complete the code below to calculate and return the tempo in BPM using the provided beats and duration.
 *
 * @param beats The number of beats in the musical piece.
 * @param duration The duration of the musical piece in the format (minutes, seconds).
 * @return The tempo of the musical piece in beats per minute (BPM).
 */
fun calculateTempo(beats: Int, duration: Pair<Int, Int>): Double {

    val totalSeconds = duration.first * 60 + duration.second
    val tempo = beats.toDouble() / (totalSeconds / 60.0)
    return tempo
}