I am trying to solve this problem in which I am given a number n, representing the number of vertexes in a undirected graph. On the next line there are n natural numbers representing the degree of the respective vertex. I am asked to find the edges, such that the graph is connected.
n<=5000 and it is forbbiden that two or more edges connect the same two vertexes.
LE: Also, there will always exist a graph with the degrees given in the tests.