https://www.acmicpc.net/problem/status/8452
the problem is
A directional graph G is given. When the length of all trunks is 1, you must process two queries.
- Remove one trunk.
- Outputs the shortest path from vertex 1 to vertex i. If there is no path, -1 is output.
|V| <= 10^3, M, Q <= 10^5