Https://www.codechef.com/viewsolution/46490389

https://www.codechef.com/viewsolution/46490389
This is Tree House Problem from May Long Challenge 2021, and I don’t know where did I went wrong…and what was my mistake.