This problem is in Contest(s) below:
Contest 1152:搜索基础
Contest 1072:长训班BFS专题
Contest 1103:2022寒假提高班练习题