HDU 1241 (bfs)