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