ГлавнаяСборникиТурнирыРазделыФорумыУчастникиПечатьПомощьО системе

Сборники > Camp. Turkey > задача:


Adjacency matrix to edges list

Задачи сборника

• The N Queens Problem
• Subsets
• Maximum Sum 2
• Gifts of Santa Claus
• Rectangles on a plane
• Permutations
• Reverse permutation
• Nameplates
• Adjacency matrix to edges list
• Edges list to Adjacency matrix
• Cities and roads
• Cycle detection
• Diameter of graph
• Divisors count
• GCD of ones
• Prime numbers
• Set cover problem

Обратная связь

Если у вас есть предложения или пожелания по работе Contester, посетите форум сайта www.contester.ru.

Лимит времени 1000/1000/1000/1000 мс. Лимит памяти 65000/65000/65000/65000 Кб.

Problem description

Given adjacency matrix of undirected graph. Print this graph in form of edges list.

Input

The first line of the input contains an integer N (1 ≤ N ≤ 100) that denotes the number of verticies in graph. Each of the following N lines contains N integers 1 or 0, where 1 denotes edge and 0 if there is no edge.

Output

Print the edges list of given graph.

Example

stdin stdout

3
0 1 1
1 0 1
1 1 0

1 2
2 3
1 3

Для отправки решений необходимо выполнить вход.

www.contester.ru