There is a directed acyclic graph with N vertices and M edges. The aim is to destroy the graph - by deleting all of its vertices in minimum number of steps.
Rules for deletion in one step:
- At most 2 vertices can be deleted.
- A vertex can only be deleted if there is no edge from it to any non deleted vertex.
- If two vertices are deleted in one step there must not be an edge between them.
Constraints : N,M <= 10^6, and graph has no self loops and cycles.