Approximate two integers of equation (fastest algorithm) Not sure if it's a right place, though...
I have a formula $\frac{C_1}{C_2} = C = {x}{y}$, where $C_1, C_2, C, x, y \in \mathbb{N}$, more precisely $x = [1 \dots 32], y = [1 \dots 8192], C = [1 \dots 32*8192]$.What is the fastest algorithm to find $x$ and $y$ that their multiplication would have a minimum difference to $C$?
Consider two examples:
$C = 10000$, the answer is $(2, 5000)$, or $(5, 2000)$ and so on.
$C = 67811$, the answer is $(19, 3569)$.

You want $x$ and $y$ to be the factors of $C$ closest to $\sqrt C$, one above and one below.  For small numbers like you are talking about, you can factor $C$ and check all the factors.   
Added after the comments. As $x$ is limited to $[1,32]$ I would suggest you take $\sqrt C$ and round it down to $32$ or to the next whole number if the square root is below $32$.  Then just check numbers for whether they divide into $C$ exactly, progressing downward.  The first one that divides $C$ exactly is the $x$ you want, then $y=\frac Cx$.  It might be faster first to divide $C$ by small primes to eliminate possibilities.  If you try $2$ first and it fails you don't have to try any even numbers.
