https://codeforces.com/problemset/problem/1327/E

Can anyone explain me the approach to solve this problem? I am unable to understand the codeforces editorial.

https://codeforces.com/problemset/problem/1327/E

Can anyone explain me the approach to solve this problem? I am unable to understand the codeforces editorial.

It’s not a dp.