August-Lunchtime 2019-TRIP2

Can anyone please point out what is wrong with my code for TRIP2 August lunchtime 2019?https://www.codechef.com/viewsolution/26187568

Try this test case:
5 2
-1 -1 2 -1 -1
Your answer is NO for this case but the actual answer is 2 1 2 1 2.

3 Likes