  This paper deals with a variation of the classical isoperimetric problem in
dimension $N\ge 2$ for a two-phase piecewise constant density whose
discontinuity interface is a given hyperplane. We introduce a weighted
perimeter functional with three different weights, one for the hyperplane and
one for each of the two open half-spaces in which $\mathbb{R}^N$ gets
partitioned. We then consider the problem of characterizing the sets $\Omega$
that minimize this weighted perimeter functional under the additional
constraint that the volumes of the portions of $\Omega$ in the two half-spaces
are given. It is shown that the problem admits two kinds of minimizers, which
will be called type I and type II, respectively. These minimizers are made of
the union of two spherical domes whose angle of incidence satisfies some kind
of \textquotedblleft Snell's law\textquotedblright. Finally, we provide a
complete classification of the minimizers depending on the various parameters
of the problem.
