CANDLE - Help spot the test case for which my code fails

Can anyone help me find why am I getting wrong answer for this submission ?
Problem : CANDLE Problem - CodeChef
Solution : http://www.codechef.com/viewplaintext/3622427

I took a diff of your solution’s output with accepted solution’s code output. The sample cases where your solution fails are given below :

2 17 10 5 18 9 6 3 7 18 Your solution 7000 correct answer is 1000

0 7 13 16 10 2 5 10 11 12 Your solution 50 correct answer is 10

3 12 4 7 15 12 16 7 17 4 Your solution 20000 correct answer is 10000

In case of wrong answer better write a brute force solution and a random input generator code. Then for each randomly generated test case check the output of your code. Then compare it with brute force code’s solution. In this way you would be easily able to figure out errors in your solution.

1 Like

http://www.codechef.com/viewplaintext/3124218

Thanks. But I don’t need a new solution, I want to know my error

Can you please spot me a test case for which my code fails ?

@admin Can I know the test-case for which I am getting WA ?

Thank you.