EIUDEG - Degree

Xem dạng PDF

Gửi bài giải

Điểm: 1,00 (OI)
Giới hạn thời gian: 1.0s
Giới hạn bộ nhớ: 256M
Input: stdin
Output: stdout

Nguồn bài:
Hà Minh Ngọc
Dạng bài
Ngôn ngữ cho phép
C, C++, Java, Kotlin, Pascal, PyPy, Python, Scratch

Given an undirected graph of ~n~ vertices and ~m~ edges. Output the degree of vertices.

Input

  • The first line contains two integers ~n~ and ~m~ ~( 1 ≤ n ≤ 1000, 0 ≤ m ≤ min(10^5, n*(n-1)/2) )~
  • Each line in the next m lines contains two integers ~u, v~ ~(1 ≤ u, v ≤ n )~ - representing the connecting edge from ~u~ to ~v~.

Output

  • A line of ~n~ numbers: ~deg_1, deg_2, ... deg_n~, respectively, is the degree of vertices ~1,2, ... n~.

Example Input

2 1
1 2

Example Output

1 1

Bình luận

Hãy đọc nội quy trước khi bình luận.


Không có bình luận tại thời điểm này.