Hi guys, I'm new to DP how we can solve a problem DP need sorting for optimize order like this problem: https://atcoder.jp/contests/dp/tasks/dp_x.
Idk how to improve the optimal sorting order. Can some one help me and tell me how to solve problem like that? D: