function [cell1, cell2] = provide_pair(nCells, selPair)
%%
assert(selPair <= nCells*(nCells-1)/2,...
    "Selected pair is larger than the number of available pairs");

tmpPair = selPair;
count = 0;

while tmpPair > 0
%     tmpPair
%     nCells - count - 1
    tmpPair = tmpPair - (nCells - count - 1);
    count = count + 1;
end

cell1 = count;

tmpPair = 0;

for i = 1:cell1-1
    % tmpPair
    tmpPair = tmpPair + nCells - i;
end

cell2 = selPair - tmpPair;
cell2 = cell1 + cell2;

end