def work_divider(no_of_cells, n_threads):
    """Divide the no of cells almost equally among n_threads

    no_of_cells = The number of cells we need to divide among threads
    n_threads = The number of threads among which we divide the cells
    """
    N = no_of_cells
    M = n_threads
    for i, k in enumerate(range(M)):
        start_index = N * k // M + 1
        inc = N * (k + 1) // M - start_index
        end_index = start_index + inc
        if end_index - start_index < 0:
            i = i - 1
            continue
        yield i, start_index, end_index
