This problem is in Contest(s) below:
Contest 1005:竞赛较难题型练习
Contest 1102:2022寒假基础班练习题