topcoder recursion