This problem is in Contest(s) below:
Contest 1536:NJ23秋季信息学奥赛提高-8
Contest 1537:NJ23秋季信息学奥赛基础-9