Hello,

I was solving [this][1] problem and firstly I formulated [recursion][2] which shows TLE on test 11(it obviously should). I then tried saving the answer, approaching the problem like dp. But I don’t know why the

```
[3] shows WA on test 7. I think I doing some mistake while saving the answer. Any help would be highly appreciated.
Thanks :)
[1]: http://codeforces.com/contest/987/problem/C
[2]: http://codeforces.com/contest/987/submission/38748342
[3]: http://codeforces.com/contest/987/submission/38736017
```