  We study the Monge--Kantorovich problem with one-dimensional marginals $\mu$
and $\nu$ and the cost function $c = \min\{l_1, \ldots, l_n\}$ that equals the
minimum of a finite number $n$ of affine functions $l_i$ satisfying certain
non-degeneracy assumptions. We prove that the problem is equivalent to a
finite-dimensional extremal problem. More precisely, it is shown that the
solution is concentrated on the union of $n$ products $I_i \times J_i$, where
$\{I_i\}$ and $\{J_i\}$ are partitions of the real line into unions of disjoint
connected sets. The families of sets $\{I_i\}$ and $\{J_i\}$ have the following
properties: 1) $c=l_i$ on $I_i \times J_i$, 2) $\{I_i\}, \{J_i\}$ is a couple
of partitions solving an auxiliary $n$-dimensional extremal problem. The result
is partially generalized to the case of more than two marginals.
