here's the question.. it was asked in inoi 2010 http://www.iarcs.org.in/inoi/2010/inoi2010/inoi2010qpaper.pdf can somebody provide the algorithm to solve this question and if possible the code too. PS: i did not understand malavika's code on github EDIT: I FORGOT TO MENTION THE QUESTION: QUESTION 2: TWIN ROBOTS asked 07 Jan '17, 11:00

Initially I had also struggled with this problem and you're right that Malvika's code is really complex for this problem. Let me give you a big hint which just then boils down to the solution. The key for this problem relies on the fact that if the position of R2D2 robot is $a[i][j]$ then the position of the other robot C3PO is $a[j][ni1]$ since whenever R2D2 takes a step to the right or down then C3PO has to take a step down or left respectively. Here is the problem on CodeChef for you to practice : https://www.codechef.com/problems/TWINRO Let me explain further. As usual, DP comes into the play. Let $DP[i][j]$ denote the maximum score that the two robots have achieved if R2D2's position is $i, j$. From the above key I told you, now you also know the position of the other robot. Now you just take $max(DP[i1][j], DP[i][j1])$ for reaching the position $i, j$ (as these are only positions from which R2D2 would have come to $i, j$) and add the current score of of the two robots. Then the final answer awaits for you at $DP[n1][n1]$ since that is the final position of R2D2. That key hint will take care of adding C3PO's scores as well ;) Hope this helps. Here's my code : https://www.codechef.com/viewsolution/12432523 answered 07 Jan '17, 14:10
thanks a lot..
(07 Jan '17, 14:24)
Glad to know that. If you feel the question has been answered, then please the accept the answer :)
(07 Jan '17, 14:59)

I have provided a code in c. Feel free to ask if you have any problem in the following code.
} answered 07 Jan '17, 11:15

please see the code below