[question↵
Educational Codeforces Round 76 (Rated for Div. 2)↵
D-Yet Another Monster Killing Problem](https://mirror.codeforces.com/contest/1257/problem/D)↵
↵
[my submission 69496905](https://mirror.codeforces.com/contest/1257/submission/69496905)↵
↵
I am not able to understand which test case is failing any testcase would be highly helpful ..↵
↵
I have put the following conditions↵
*if maximum power of hero is less than maximum power of monsters then directly print -1 and exit↵
↵
*else answer exists we iterate throughout and we create the bst array which is as described in the [editorial](https://mirror.codeforces.com/blog/entry/71434).Using which we check the 2 conditions :-↵
↵
--->if maximum in a our range is greater than our hero's power then we break and add a count to our days↵
↵
--->if we have reached the hero with highest endurance and have exhausted him too then we again break and add a ↵
count to our days↵
↵
I believe this covers all the possibilities ..↵
↵
↵
please help me .↵
↵
Thanks in Advance↵
↵
↵
↵
EDIT ↵
GUYS IT IS NOW WORKING THE ERROR WAS THAT I HAD INCREMENTED THE INDEX OF HEROES ONLY BY 1 EACH TIME WHICH DID NOT COVER ALL THE CASES.↵
I HAD TO INCREMENT THE INDEX OF HEROES TILL I FOUND ONE WITH HIGHER ENDURANCE.↵
↵
THANKS A LOT EVERYONE FOR YOUR REPLIES.↵
↵
[NEW SUBMISSION -- WORKING ](https://mirror.codeforces.com/contest/1257/submission/69584650)↵
[OLD SUBMISSION ](https://mirror.codeforces.com/contest/1257/submission/69496905)↵
↵
I HAVE UPLOADED THE CHANGES YOU CAN SEE
Educational Codeforces Round 76 (Rated for Div. 2)↵
D-Yet Another Monster Killing Problem](https://mirror.codeforces.com/contest/1257/problem/D)↵
↵
[my submission 69496905](https://mirror.codeforces.com/contest/1257/submission/69496905)↵
↵
I am not able to understand which test case is failing any testcase would be highly helpful ..↵
↵
I have put the following conditions↵
*if maximum power of hero is less than maximum power of monsters then directly print -1 and exit↵
↵
*else answer exists we iterate throughout and we create the bst array which is as described in the [editorial](https://mirror.codeforces.com/blog/entry/71434).Using which we check the 2 conditions :-↵
↵
--->if maximum in a our range is greater than our hero's power then we break and add a count to our days↵
↵
--->if we have reached the hero with highest endurance and have exhausted him too then we again break and add a ↵
count to our days↵
↵
I believe this covers all the possibilities ..↵
↵
↵
please help me .↵
↵
Thanks in Advance↵
↵
↵
↵
EDIT ↵
GUYS IT IS NOW WORKING THE ERROR WAS THAT I HAD INCREMENTED THE INDEX OF HEROES ONLY BY 1 EACH TIME WHICH DID NOT COVER ALL THE CASES.↵
I HAD TO INCREMENT THE INDEX OF HEROES TILL I FOUND ONE WITH HIGHER ENDURANCE.↵
↵
THANKS A LOT EVERYONE FOR YOUR REPLIES.↵
↵
[NEW SUBMISSION -- WORKING ](https://mirror.codeforces.com/contest/1257/submission/69584650)↵
[OLD SUBMISSION ](https://mirror.codeforces.com/contest/1257/submission/69496905)↵
↵
I HAVE UPLOADED THE CHANGES YOU CAN SEE