/**
 * Given a dictionary, loop through its elements and divide each value by its corresponding key.
 *
 * @param dictionary A dictionary with numerical values as keys and values.
 * @return A new dictionary with the divided values.
 */
fun divideByKey(dictionary: Map<Int, Int>): Map<Int, Double?> {

    val resultDict = mutableMapOf<Int, Double?>()
    for ((key, value) in dictionary) {
        resultDict[key] = try {
            value.toDouble() / key
        } catch (e: Exception) {
            null
        }
    }
    return resultDict
}
/**
 * Given a dictionary, loop through its elements and divide each value by its corresponding key.
 *
 * @param dictionary A dictionary with numerical values as keys and values.
 * @return A new dictionary with the divided values.
 */
fun divideByKey(dictionary: Map<Int, Int>): Map<Int, Double?> {
/**
 * Given a dictionary, loop through its elements and divide each value by its corresponding key.
 *
 * @param dictionary A dictionary with numerical values as keys and values.
 * @return A new dictionary with the divided values.
 */
fun divideByKey(dictionary: Map<Int, Int>): Map<Int, Double?> {

    val resultDict = mutableMapOf<Int, Double?>()
    for ((key, value) in dictionary) {
        resultDict[key] = try {
            value.toDouble() / key
        } catch (e: Exception) {
            null
        }
    }
    return resultDict
}