luogu#P12106. [NWRRC2024] Brick in the Wall, Part 2

[NWRRC2024] Brick in the Wall, Part 2

3
3 3
s.#
...
#.f
6 7
..#.#..
s..#..#
....#f.
#..#...
#......
#.....#
2 2
s.
.f
1
2
-1