24. Suppose that $x$ and $y$ are positive integers such that $x+2 y=2008$ and $x y$ has the maximum value. Find the value of $x-y$.
24. Answer: 502
Since $x+2 y=2008, x \cdot 2 y$ has the maximum value if and only if $x=2 y=\frac{2008}{2}=1004$. Note that $2 x y$ has the maximum value if and only if $x y$ does. Thus $x-y=1004-502=502$.