Https://www.codechef.com/viewsolution/32225271

Here is a link to my solution for FFL: CodeChef: Practical coding for everyone
Can anyone tell me where I was wrong?

You are not checking the condition that both type of players are present or not.
eg-
1
n=2 s=50
10 20
0 0

Oh yes! Now it is working fine! Thanks.