This problem is in Contest(s) below:
Contest 1069:2023-WE 百题大战09:递归、迭代法和结构体
Contest 1038:Python-第6章-函数