From adjacency matrix to the list of edges - 2#4766

From adjacency matrix to the list of edges - 2

1 segundo
128 megabytes
Fácil

The simple oriented graph is given by the adjacency matrix. Print its representation as a list of edges.

Entrada

The first line contains number of vertices (1 \le n \le 100) in the graph. Each of the next lines contains elements – the description of adjacency matrix.

Salida

Print the list of edges, ordered first by the first vertex in a pair that describes an edge, then by the second vertex.

Ejemplos

Ejemplo 1

Loading
Loading