View Single Post
Old Oct 11th, 2007, 12:38 PM   #6
ZenMasterJG
Hobbyist Programmer
 
ZenMasterJG's Avatar
 
Join Date: Nov 2004
Location: Boston, MA
Posts: 148
Rep Power: 4 ZenMasterJG is on a distinguished road
Send a message via AIM to ZenMasterJG
I took a quick stab at it. I'm not done, but heres a strategy I was working on.
First, find the maximum value for x (by minimizing y) and then a max value for y (by minimizing x)

to find the max value of x, write a loop that breaks when a solution is found, set y and x to 1, and increase x until the result is greater then c, then increment y and repeat (hope thats understandable)

To find all solutions, then, you could just bruteforce it and try every combination of numbers less then max x and max y. Theres certainly cleverer ways to do it, thats just as far as i've gotten so far and I have to go to class now

good luck, hope that hint helps.
ZenMasterJG is offline   Reply With Quote