Expected output is faulty for below test case


#1

3 3
2 3 3
5 10 1
10 30 5

For this test case output should be zero. But expected output is 1.


#2

No, “at any point of time(even intially) if his health is “0”,he will die”…so health should never be less than 1.