/**
 * Given a dictionary of photographers and their number of photographs taken in a day,
 * returns the average number of photographs taken in a month.
 *
 * @param photographerDict a dictionary where keys are photographer names (strings) and values
 * are lists of integers representing the number of photographs taken by
 * the photographer for each day in a month.
 *
 * @return a float representing the average number of photographs taken in a month by all
 * the photographers.
 */
fun checkAveragePhotographs(photographerDict: Map<String, List<Int>>): Float {

    var total = 0
    var count = 0

    for ((_, days) in photographerDict) {
        for (day in days) {
            total += day
            count++
        }
    }

    return if (count > 0) total.toFloat() / count else 0f
}

val photographerData = mapOf(
    "John" to listOf(50, 30, 60, 40),
    "Alice" to listOf(80, 95, 70, 60),
    "Mark" to listOf(45, 65, 70, 85)
)

val averagePhotographs = checkAveragePhotographs(photographerData)
/**
 * Given a dictionary of photographers and their number of photographs taken in a day,
 * returns the average number of photographs taken in a month.
 *
 * @param photographerDict a dictionary where keys are photographer names (strings) and values
 * are lists of integers representing the number of photographs taken by
 * the photographer for each day in a month.
 *
 * @return a float representing the average number of photographs taken in a month by all
 * the photographers.
 */
fun checkAveragePhotographs(photographerDict: Map<String, List<Int>>): Float {
/**
 * Given a dictionary of photographers and their number of photographs taken in a day,
 * returns the average number of photographs taken in a month.
 *
 * @param photographerDict a dictionary where keys are photographer names (strings) and values
 * are lists of integers representing the number of photographs taken by
 * the photographer for each day in a month.
 *
 * @return a float representing the average number of photographs taken in a month by all
 * the photographers.
 */
fun checkAveragePhotographs(photographerDict: Map<String, List<Int>>): Float {

    var total = 0
    var count = 0

    for ((_, days) in photographerDict) {
        for (day in days) {
            total += day
            count++
        }
    }

    return if (count > 0) total.toFloat() / count else 0f
}

val photographerData = mapOf(
    "John" to listOf(50, 30, 60, 40),
    "Alice" to listOf(80, 95, 70, 60),
    "Mark" to listOf(45, 65, 70, 85)
)

val averagePhotographs = checkAveragePhotographs(photographerData)