why the dp approach gives wa?
https://mirror.codeforces.com/contest/1272/submission/104396526 https://mirror.codeforces.com/contest/1272/problem/E