def helper_find_shared_time(time, res):
    """Helper to find the time which is still free (not allocated) after the given
    time for the whole set of resources combined.

    :param time: the first time step to consider

    :param res: the list of resources:
    """
    if not res:
        return 0
    t = None
    for r in res:
        res_time = r.time_free(time=time)
        if t is None:
            t = res_time
        else:
            t = min(t, res_time)
    return t
