This is in relation to the question I posted on stackoverflow which Aakash has mentioned. After searching a bit more, I got to know that the equation I was trying to solve is called diophantine equation. And there is a treasure trove of information related to that.
If someone wants to cheat and solve the question, they can easily search for that on the internet and get it over with. The aim here is to promote a healthy discussion and come up with the best algorithm. It was not a "plz send teh codez" type of question.
Isn't stack overflow supposed to be a forum for collaborating, helping, asking questions and developing your skills? It was because of the question I posted that I came to know of how my fellow programmers think to come up with a solution in the least running time. Moreover, I checked the codechef problem and it seems to be more complex than what I was trying to achieve.
If you are so skeptical of the issue then you may also not like similar links I stumbled across:
Solving a Linear Diophantine Equation(see description for examples)
How to solve Linear Diophantine equations in programming?
And I can promise there are more out there.
P.S. I never knew that CodeChef doles out awards to winners every month. Although I knew that TopCoder does that.
Rules: Please do not discuss strategy, suggestions or tips in the comments during a live contest. Posting questions clarifying the problem statement is ok.