CF329C Graph Reconstruction
Description
I have an undirected graph consisting of $ n $ nodes, numbered 1 through $ n $ . Each node has at most two incident edges. For each pair of nodes, there is at most an edge connecting them. No edge connects a node to itself.
I would like to create a new graph in such a way that:
- The new graph consists of the same number of nodes and edges as the old graph.
- The properties in the first paragraph still hold.
- For each two nodes $ u $ and $ v $ , if there is an edge connecting them in the old graph, there is no edge connecting them in the new graph.
Help me construct the new graph, or tell me if it is impossible.
Input Format
N/A
Output Format
N/A
Explanation/Hint
The old graph of the first example:

A possible new graph for the first example:

In the second example, we cannot create any new graph.
The old graph of the third example:

A possible new graph for the third example:
