WA in HELLO HELLO.

i submitted two versions of the same algorithm for this question.Problem Code:HELLO Problem - CodeChef.
My 2 solutions are:
1) CodeChef: Practical coding for everyone
2) CodeChef: Practical coding for everyone. The first solution is giving wrong answer while the second one is getting accepted even though both perform the same function with a slight difference in implementation.can someone clarify???

In the first solution u are not initializing ans to zero every time . If you do so that will also be AC . Here is the code : CodeChef: Practical coding for everyone

oh!!that was careless on my part,and thanks for pointing out the mistake.

Yes both have same functionality,

We have to find the max value of m=d-((r * u)+(c/m));

Which can also be done by finding the minimum value of ((r * u)+(c/m))


Now, here's the mistake:
**Just assign ans=0; for each test case.**
Here's the link to the corrected solution:
http://www.codechef.com/status/HELLO,pratku123

Cheers

Welcome . If you find my answer useful please upvote and accept it .

hello my name is Carolyn Pierce from india vidmate mobdro