  We give a necessary and sufficient condition for the following property of an
integer $d\in\mathbb N$ and a pair $(a,A)\in\mathbb R^2$: There exist $\kappa >
0$ and $Q_0\in\mathbb N$ such that for all $\mathbf x\in \mathbb R^d$ and
$Q\geq Q_0$, there exists $\mathbf p/q\in\mathbb Q^d$ such that $1\leq q\leq Q$
and $\|\mathbf x - \mathbf p/q\| \leq \kappa q^{-a} Q^{-A}$. This generalizes
Dirichlet's theorem, which states that this property holds (with $\kappa = Q_0
= 1$) when $a = 1$ and $A = 1/d$. We also analyze the set of exceptions in
those cases where the statement does not hold, showing that they form a
comeager set. This is also true if $\mathbb R^d$ is replaced by an appropriate
"Diophantine space", such as a nonsingular rational quadratic hypersurface
which contains rational points. Finally, in the case $d = 1$ we describe the
set of exceptions in terms of classical Diophantine conditions.
