D. The Enchanted Forest | Codeforces Round #796 (Div. 2) - Hitesh Tripathi