eolymp
bolt
Try our new interface for solving problems
Problems

Degrees of vertices by a list of edges

Degrees of vertices by a list of edges

Undirected graph is given with a list of edges. Find the degrees of all its vertices. \InputFile The first line contains the number of vertices in a graph $n~(1 \le n \le 100)$ and the number of edges $m~(1 \le m \le n \cdot (n - 1) / 2)$. The given $m$ pairs of integers --- the edges of the graph. \OutputFile Print $n$ numbers --- the degrees of graph vertices. \includegraphics{https://eolympusercontent.com/images/532f5jqj1h4h18k12m5gdt982o.gif}
Time limit 1 second
Memory limit 128 MiB
Input example #1
4 4
1 2
1 3
2 3
3 4
Output example #1
2
2
3
1