This problem is in Contest(s) below:
Contest 1274:冲剌Noip2018之二
Contest 1351:杂题选讲
Contest 1374:2019暑假队测