HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Volumes > Camp. Turkey > problem:


Edges list to Adjacency matrix

Volume problems

• 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
• Shopping

Feedback

If you notice incorrect translations in Contester, please let author know.

Time limit 1000/1000/1000/1000 ms. Memory limit 65000/65000/65000/65000 Kb.

Problem description

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

Input

The first line of the input contains two integers N and M (1 ≤ N ≤ 100, 1 ≤ M < 10000) where N denotes the number of verticies in graph, M - number of edges. Each of the following M lines contains two integers - one edge of graph.

Output

Print the adjacency matrix of given graph.

Example

stdin stdout

3 3
1 2
2 3
1 3

0 1 1
1 0 1
1 1 0

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

www.contester.ru