Below are the links to both the problems. https://atcoder.jp/contests/dp/tasks/dp_m
https://atcoder.jp/contests/dp/tasks/dp_j
I have read and re-read the problems again and again but I am not able to understand how to solve these two. I have seen the submissions of other contestants also, even from that I am not able to make much sense. Can you please explain how to approach these problems and suggest similar problems that use the same concept. Thanks