Half-degrees of vertices by edge lists
Execution time limit is 1 second
Runtime memory usage limit is 64 megabytes
The graph is represented by a list of edges.
Your task is to determine the in-degree and out-degree of each vertex in the graph.
Input
The input file begins with two numbers: n (1 ≤ n ≤ 100), representing the number of vertices in the graph, and m (1 ≤ m ≤ n(n - 1)), representing the number of edges. Following this are m pairs of numbers, each pair representing an edge in the graph.
Output
For each vertex, output a pair of numbers: the in-degree followed by the out-degree. There should be n such pairs in the output file.
Examples
Input #1
Answer #1
Submissions 2K
Acceptance rate 71%