877E - Danil and a Part-time Job is an interesting problem that requires queries and updates on subtrees of a tree. It is a great problem to learn a variation of traditional segment trees.
I created a video tutorial explaining the problem. I explained how to order the nodes so that it's possible to use a segment tree and how to do toggle updates.
Here is my YouTube channel with all the video tutorials.