used a linear dp with binary search. I am not able to figure out which test cases it failed. Here is the link to my solution http://www.codechef.com/viewsolution/6295573 I will be really glad if somebody could tell me the mistake.
Hey, try out this test case.
2 2 4
0 0 1 0
0 0 2 1
2 1 3 0
2 1 3 0
Ans should be 15 but your code gives 14.
1 Like