This problem is in Contest(s) below:
Contest 1101:2022第一次练习
Contest 1311:ACM训练题三(大二)