This problem is in Contest(s) below:
Contest 1142:寒假练习181191
Contest 1301:树