link to the question: http://codeforces.net/contest/455/problem/A
my submission: 75708843
The code has been written in python and dynamically programmed. But, i am getting TLE on test case 11. Please ,help in optimising the code if possible and if not; please tell why the code is getting TLE; is it because of python being a slower language or there is some issue in code?? PLEASE, HELP OUT!!