This problem is in Contest(s) below:
Contest 1380:DFS_YC
Contest 1385:初一小朋友的递归练习
Contest 1379:递归基础入门