CARS_PER_HOUR = 221

function success_rate(speed)
    if speed == 0
        success = 0
    elseif 1 ≤ speed ≤ 4
        success = 100
    elseif 5 ≤ speed ≤ 8
        success = 90
    elseif speed == 9
        success = 80
    elseif speed == 10
        success = 77
   end
   return success / 100
end

function production_rate_per_hour(speed)
    return CARS_PER_HOUR * speed * success_rate(speed)
end

function working_items_per_minute(speed)
    return Int(production_rate_per_hour(speed) ÷ 60)
end