Happy new year to everyone, I was solving ACPC10D problem from spoj LINK but I am constantly getting RTE SIGSEGV while submitting. I have tried all the testcases which are mentioned in the forum and my solution gives correct output to every testcase. Then Can you help me in finding bug the code CODE? The people in the forum commented that it is not possible to solve it with top down approach. Howeever it is simple dp problem and my solution seems to be correct. So please, help me out.