I was recently solving dp on tree type problems and i came across this.
do you think the solution given in editorial is correct.I feel it doesnt include all the cases.He says for every vertex as root , consider all subtrees...This doesnt include all the possible Sets S. Please someone explain this to me
Thanks in advance








Can someone elaborate the centroid decomposition idea for this question.?