I was solving http://mirror.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:
Accepted : http://mirror.codeforces.com/contest/560/submission/12186813
TLE : http://mirror.codeforces.com/contest/560/submission/12186933
Is there any reason why it failed or is it by pure co-incidence that the test cases broke my program.