def num_in_ranges(ranges, num: int):
    """
    Returns whether a number is in a list of sorted ranges.
    """
    if len(ranges) > 1:
        if num < ranges[len(ranges) // 2][0]:
            return num_in_ranges(ranges[:len(ranges) // 2], num)
        else:
            return num_in_ranges(ranges[len(ranges) // 2:], num)
    elif len(ranges) == 1:
        return num >= ranges[0][0] and num <= ranges[0][1]
    else:
        return False