Google kick start round E
How to solve problem D any help would be appreciated
Codeforces Round 950 Solution Discussion