Solution (source code)

= Solution

Let $H_k$ be the ordinary <Hilbert class field> of $k$. Its real places split completely, so $H_k$ is totally real. Since $K/k$ is quadratic and $K$ is totally imaginary, $H_k\cap K$ cannot equal $K$; hence it equals $k$. Therefore the <compositum> $KH_k$ has
$$
[KH_k:K]=[H_k:k]=h_k,
$$
and is an abelian extension of $K$, by restriction of the <Galois group> to $H_k$. At finite primes it is unramified because <unramified extensions remain unramified under base change>. The field $K$ has no real places, so there is no infinite-place ramification condition left. Thus $KH_k\subseteq H_K$, where $H_K$ is the <Hilbert class field> of $K$. Since $[H_K:K]=h_K$, the tower degree formula proves <class number divisibility for a CM extension>:
$$
\boxed{h_k\mid h_K.}
$$
This argument uses the ordinary class field with split real places; replacing it silently by the narrow class field would invalidate the claim that $H_k$ is totally real.