This problem is in Contest(s) below:
Contest 1003:竞赛基础题型练习
Contest 1162:2025春季入门班课程