How to solve this problem of CEOI Mirror 2020?
Can someone please tell me how to solve this problem? I saw the editorial but couldn't understand how to solve the subtask 7. Thanks in advance.
Atcoder ABC #354 Solution Discussion