Rescue - Wrong Answer

I have been trying very hard but really cant find any error in my code when I run this code
on my machine bt Codechef gives a wrong answer. I have tried my code for the weirdest of test cases and all seems fine. Any help will be greatly appreciated. Rescue problem

@engi1niku Your program gives wrong output

for example if input is `

 9999 7 10000 8888

output should be

7 14 84

but your program gives

 7 14 7999

Ok. Got it. Thanx a lot. My bad


Sorry for bothering bt I made changes and now it works well for the kind of cases u mentioned bt yet I get a Wrong Answer from Codechef. Here is the code

@engi1niku1 I have not studied your code i just tried boundary conditions it seems to work fine now… Here is your program tested with various inputs i could think of…

But if codechef is saying wrong answer then there must be one ore more test cases for which your output is off… I will definitely tell you if i get anything

1 Like

my pleasure enjoy coding :slight_smile: