Wrong Answer in Spoj Army

I am unable to understand why I am getting WA in this problem
Will someone please point out the mistake or provide me the test case for which my Algo fails …i have used the approach of comparing each and every soldier of the army by their strength …My solution link is http://ideone.com/02V8D2

Someone please help me