/**
 * This function calculates the number of movable items based on the weight, distance, and temperature.
 *
 * @param weight The weight of the items in kg.
 * @param distance The distance to be covered in meters.
 * @param temperature The temperature in degree Celsius.
 * @return The number of movable items.
 * @throws IllegalArgumentException If the weight or distance is negative.
 */
fun calculateMovableItems(weight: Int, distance: Int, temperature: Int): Int {

    if (weight <= 0 || distance <= 0) {
        throw IllegalArgumentException("Weight and distance should be positive integers.")
    }

    return if (temperature >= 30 && weight > 100) {
        weight * distance
    } else if (temperature <= 10 && weight <= 50) {
        weight + distance
    } else if (temperature >= 10 && distance > 500) {
        weight - distance
    } else {
        (weight + distance) / 2
    }
}
/**
 * This function calculates the number of movable items based on the weight, distance, and temperature.
 *
 * @param weight The weight of the items in kg.
 * @param distance The distance to be covered in meters.
 * @param temperature The temperature in degree Celsius.
 * @return The number of movable items.
 * @throws IllegalArgumentException If the weight or distance is negative.
 */
fun calculateMovableItems(weight: Int, distance: Int, temperature: Int): Int {
/**
 * This function calculates the number of movable items based on the weight, distance, and temperature.
 *
 * @param weight The weight of the items in kg.
 * @param distance The distance to be covered in meters.
 * @param temperature The temperature in degree Celsius.
 * @return The number of movable items.
 * @throws IllegalArgumentException If the weight or distance is negative.
 */
fun calculateMovableItems(weight: Int, distance: Int, temperature: Int): Int {

    if (weight <= 0 || distance <= 0) {
        throw IllegalArgumentException("Weight and distance should be positive integers.")
    }

    return if (temperature >= 30 && weight > 100) {
        weight * distance
    } else if (temperature <= 10 && weight <= 50) {
        weight + distance
    } else if (temperature >= 10 && distance > 500) {
        weight - distance
    } else {
        (weight + distance) / 2
    }
}