Graph Orientation
An undirected graph with N vertices, numbered from 1 to N, is provided. Your task is to write a program that sequentially addresses the following tasks:
a) Calculate the number of connected components in the graph.
b) Identify and list all edges whose removal would increase the number of connected components.
c) Determine if it's possible to orient all the edges of the graph such that the resulting directed graph is strongly connected (a directed graph is strongly connected if there is a path from any vertex to every other vertex following the direction of the edges).
d) Orient the maximum number of edges to make the graph strongly connected.
e) Find the minimum number of edges that need to be added to the graph to make the answer to point c) affirmative.
Input
The input file contains an integer N (1 ≤ N ≤ 100) followed by a list of edges, each defined by the numbers of its terminal vertices.
Output
Your program should output the answers to points a)-e) in the following format:
On the first line, provide the answer to point a).
On the second line, state the number of edges identified in point b), followed by the list of these edges on subsequent lines.
On the next line, print "NOT POSSIBLE" if orienting the graph as required in point c) is impossible; otherwise, print "POSSIBLE".
Then, provide the maximum number of edges that can be oriented as per point d), followed by the list of these oriented edges on subsequent lines.
For point e), output the number of edges that need to be added to the original graph, followed by the list of these edges.
Edges should be specified by their terminal vertices, and for the answer to point d), indicate their orientation (first the starting vertex, then the ending vertex). If the answer to point a) is not equal to one, points c) and d) should not be addressed, and their answers should not be output.
Points are awarded only if the program correctly outputs the answers to all questions.