Butlers, Cuban cigars, hard liquor, and sumptuous mansions, being an Italian mobster was the life! Alfonzo aka "Finito" was the Al Capone of his day. Nothing could stand in the way of his cruelty and his brand new Colt revolver. Of course he had other "worms" that did the dirty work for him, but occasionally he would step away from his massive mahogany desk and fire his gun into the petrified glare of a nosy government official. Today was no different. Alfonzo ordered a scotch on the rocks and went straight to work planning his next urban massacre...
Generate an undirected graph with k nodes which contains n connected components in the initial graph and m in the complementary one.
Inputk, m, and n on the only line .
OutputWrite M, the number of edges, on the first line. On the following M lines, display the pairs of numbers (a,b). (a,b) meaning that there is an edge from a to b in the initial graph. If there is no solution print "Impossible" without quotes.
ConstraintsThis problem does not contain pretests!
1 ≤ k, n, m ≤ 100
1 ≤ n, m ≤ k
You are not allowed to display an edge from one node to the same node.
If there are several solutions you can print any of them
In graph theory, the complement or inverse of a graph G is a graph H on the same vertices such that two distinct vertices of H are adjacent if and only if they are not adjacent in G.
|3 1 3
|3 1 2
|3 3 3