I was solving http://codeforces.com/contest/560/problem/D
No matter how much I tried, I could not get pas testcase #91, it was always TLE for that one.
Then I tried switching the order in which the recursive function is called and then the programs passed within 31ms (program had 2s timelimit)
Here are the 2 solutions:
Is there any reason why it failed or is it by pure co-incidence that the test cases broke my program.