def get_available_resources(threshold, usage, total):
    """Get a map of the available resource capacity.

    :param threshold: A threshold on the maximum allowed resource usage.
    :param usage: A map of hosts to the resource usage.
    :param total: A map of hosts to the total resource capacity.
    :return: A map of hosts to the available resource capacity.
    """
    return dict((host, int(threshold * total[host] - resource))
                for host, resource in usage.items())