Aggressive Cows

I implemented the code for this problem and submitted it and all my test cases passed but when I submitted the same code on SPOJ, I got wrong answer. Why did this happen, can you please explain?

link of code: https://ide.codingblocks.com/s/277380

@anugrahrastogi,
Can you please share the link for SPOJ question as well

link of question: https://www.spoj.com/problems/AGGRCOW/

I just found out the mistake, I did not add variable for test cases.
Sorry for the trouble.
Thanks!!

@anugrahrastogi,
Okay. That’s great. It’s not a trouble, I am glad your doubt is resolved. :smile: