This problem is in Contest(s) below:
Contest 1049:BFS练习专题
Contest 1103:2022寒假提高班练习题