We have $k$ blocks of integer sequences $B_1,\dots,B_k$ where $B_i$ is a sequence $$a_{i,1},\dots,a_{i,n_i}$$ with $a_{i,j}\leq a_{i,j+1}$.
Denote the permutation matrix $M_{\ell,\ell'}$ that merges $B_\ell$ and $B_{\ell'}$ (there are more than one sometimes).
Assume for every pair $\ell,\ell'$ in $\{1,\dots,k\}$ we know at least one permutation matrix $M_{\ell,\ell'}$ that merges $B_\ell$ and $B_{\ell'}$.
From the $k(k-1)/2$ matrices it is possible to find the global permutation matrix $M$ that merges all the sequences. However it seems not all $k(k-1)/2$ matrices are needed.
$M$ is $n\times n$ permutation matrix where $n=n_1+\dots+n_k$. $M$ sorts every integer in all sequences. It is technically not full sorting here as all blocks are partially sorted. So we are doing merge like in mergesort. Thus I call this matrix $M$ merges all the blocks just as $M_{\ell,\ell'}$ merges blocks $B_\ell$ and $B_{\ell'}$ in sorted order. $M_{\ell,\ell'}$ is permutation matrix of size $n_{\ell,\ell'}\times n_{\ell,\ell'}$ where $n_{\ell,\ell'}=n_\ell+n_{\ell'}$.
Is it possible that only $O(k\log k)$ or may be just $o(k\log k)$ many $M_{\ell,\ell'}$ matrices suffice and is there a canonical construction of global $M$ from such minimal information? Or do we need $\Omega(k\log k)$ many $M_{ij}$?
Is the central case of $n_1=\dots=n_k=\frac{n_1+\dots+n_k}k$ any different?