9700698 | CodeChef

I used the same approach as mentioned in editorial still I got W.A multiple times…Frustrated now …Please help …Here is my solution linkMy_Submission…(I am calling function q3() from main and then a recursive function is used to determine the state of dp)