~/algor $ cat problems/graf-choqqi-darajalari
Vertex degrees
Easy
1000 ms
128 MB
20%
An undirected graph with $n$ vertices and $m$ edges is given. The vertices are numbered from $1$ to $n$. The degree of a vertex is the number of edges incident to it. Find the degree of every vertex.
Input
The first line contains two integers: $n$ and $m$. Each of the next $m$ lines contains two positive integers: $u$ and $v$ — the vertices joined by an edge.
Output
One line: $n$ space-separated integers — the degrees of vertices $1$, $2$, …, $n$.
Note
$1 \le n \le 10^{5}$
$0 \le m \le 2 * 10^{5}$
$1 \le u, v \le n$, $u \ne v$
The graph may have multiple edges: each one is counted separately.
Examples
Input #1
4 4 1 2 1 3 1 4 2 3
Output #1
3 2 2 1
Input #2
3 0
Output #2
0 0 0