Graph
InterviewTime limit2sMemory limit1024 MB
Count non-adjacent vertex pairs where adding an edge creates exactly one simple cycle, meaning the path between them is unique.
Statement
Many years ago, Alfa was given an undirected graph as a birthday present. Recently, while sorting through his belongings, he found it and was very surprised. After playing with it for a while, he became curious: how many pairs of vertices have no edge between them, such that adding an edge between them creates exactly one new simple cycle (a cycle that visits no vertex twice)?
Input
The first line contains two integers (), the number of vertices and edges in the graph. Each of the next lines contains a pair of integers (), an edge of the graph.
Output
Print the number of such vertex pairs on a single line.