This problem is in Contest(s) below:
Contest 1346:2023寒假C++编程基础集训3
Contest 1345:NJ信息学编程训练3-20
Contest 1350:2023年春季学期信奥提高组训练1