This problem is in Contest(s) below:
Contest 1478:初一小朋友树的入门
Contest 1368:最靓的仔之2