This problem is in Contest(s) below:
Contest 1478:初一小朋友树的入门
Contest 1449:YC_树的入门