Problem 2277 · Hard
Trace the start-to-end path with BFS parents, then take the path vertex nearest to the query node.
Open the interactive visualisation