Points: 7 (partial)
Time limit: 0.6s
Memory limit: 1G
Given a directed graph of vertices and edges, determine for each edge if it is possible to reach vertex from vertex given that that edge is deleted from the graph.
The first line of the input contains two space-separated integers, and .
Each of the next lines contains two space-separated integers, and , indicating that the th edge goes from vertex to .
You may assume that any given tuple appears at most once.
On the th line, given that the th edge is deleted,
YES if it is still possible to reach vertex from vertex . Print
3 3 1 2 2 1 2 3
NO YES NO