This site is a gem.
I refrained myself from asking this for some time, but looks like it's the time
Do you really get your code copyrighted or this is just ... you know...
j<5 or j<3 would be same thing here according to the conditions, I just pasted my AC code for SUPW with just adding total-rec(0,0)
I made a 2D array beause I am solving it with 2D DP :P