\begin{tikzpicture}[scale=0.80,auto]

% Draw the odd lines
\foreach \line in {0, 1, 2, 3}
  \path[edge,rounded corners,color=red]
       (1+2*\line, 9.0) -- (1+2*\line, 5.5)
    -- (1+  \line, 4.5) -- (1+  \line, 1.5)
    -- (1+2*\line, 0.5) -- (1+2*\line,-1.0);

% Draw the even lines
\foreach \line in {0, 1, 2, 3}
  \path[edge,rounded corners,color=blue]
       (2+2*\line, 9.0) -- (2+2*\line, 5.5)
    -- (5+  \line, 4.5) -- (5+  \line, 1.5)
    -- (2+2*\line, 0.5) -- (2+2*\line,-1.0);

% Line labels
\foreach \line in {0, 1, 2, 3}
  \node at (1+\line,9.3) {$u_\line$};
\foreach \line in {0, 1, 2, 3}
  \node at (5+\line,9.3) {$v_\line$};
\foreach \line in {0, ..., 7}
  \node at (1+\line,-1.3) {$w_\line$};

% Left sorted list box
\draw[fill=white] (0.75,6) rectangle (4.25,8);
\path[gray box] (1,6.25) -- (4,7.75) -- (4,6.25) -- cycle;

% Right sorted list box
\draw[fill=white] (4.75,6) rectangle (8.25,8);
\path[gray box] (8,6.25) -- (8,7.75) -- (5,6.25) -- cycle;

% Left OEM block
\draw[fill=white] (0.75,2) rectangle (4.25,4);
\node at (2.5,3) {\small $\textrm{OEM}\left(\left\lceil\frac{n}{2}\right\rceil, \left\lceil\frac{m}{2}\right\rceil\right)$};

% Right OEM block
\draw[fill=white] (4.75,2) rectangle (8.25,4);
\node at (6.5,3) {\small $\textrm{OEM}\left(\left\lfloor\frac{n}{2}\right\rfloor, \left\lfloor\frac{m}{2}\right\rfloor\right)$};

\foreach \line in {0, 1, 2}
{
  \path[comp,very thick] (2+2*\line,0) -- (3+2*\line,0);
  \draw (2+2*\line,0) circle(5pt)[color=black,fill=black] {};
  \draw (3+2*\line,0) circle(5pt)[color=black,fill=black] {};
}

\end{tikzpicture}
