Given a real number $\alpha\in \lbrack 0,1\rbrack$ and an integer $Q>0$, Dirichlet's approximation theorem guarantees the existence of a rational $a/q$, $q\leq Q$, such that $$\left|\alpha - \frac{a}{q}\right|\leq \frac{1}{q Q}.$$
Question: how do we find such a $q\leq Q$?
Continued fractions give answers to related but slightly different questions (finding $q$ such that $|\alpha - a/q|\leq 1/q Q$; finding best approximants). Can we use continued fractions to find a rational $a/q$ answering my question above?
(I suppose so, but I'd like to know how! Perhaps it is obvious.)
(Yes, I know, I should have learnt this in elementary school.)