This problem is in Contest(s) below:
Contest 1007:广度优先搜索