Hello Guys! I'm having a hard time solving problem D of typedb forces 2023 (https://codeforces.me/contest/1787/problem/D). I didn't understand the editorial too. Pls help me with this problem. Also suggest me some problems on graphs (not dfs or bfs kind) like on topo sort, undirected graph ,DSUs ,MST ,cycles etc. Thanks Guys in advance.