This problem is in Contest(s) below:
Contest 1227:递归练习
Contest 1228:递归练习2