The Lead Game giving wrong answer??

beginner
problem
simple

#1

The code works fine for simple test case but giving wrong answer on evaluation.

My code is at the following link - [link text][1]

Please tell me what is wrong in the code
[1]: https://ideone.com/VAZF91


#2

Try with:

3

20 100

20 100

1000 0

The result should be player 1 with (1000+20+20)-(100+100)=840 lead points.

Your program gives player 1 with 1000 lead points.


#3

Computaholics


#4

Yes , according to the question it should give 1 1000 as output if i am not mistaken . The question link is - https://www.codechef.com/problems/TLG.
Please see to it.


#5

Oh yes you are right , i misunderstood the question