def find_which_schedule_this_belongs_to(schedule_array, sample_val):
    """
    Takes a sample and determines with schedule this belongs to.
    Note: A schedule is task * task sized
    :param sample_val: an int
    :return: schedule num
    """
    for i, each_array in enumerate(schedule_array):
        if each_array[0] <= sample_val <= each_array[1]:
            return i
        else:
            continue