RR là một đất nước rộng lớn với N thành phố và M đường hai chiều kết nối các thành phố. Để ngăn chặn tỷ lệ tai nạn, chính phủ quyết định thay đổi tất cả những con đường được định hướng, cho phép xe đi vào chỉ có một cách. Nhưng điều này có thể gây ra các vấn đề ách tắc giao thông ở các thành phố, khi có nhiều con đường dẫn đến các thành phố tương tự. Vì vậy, chính phủ muốn giảm thiểu số lượng tối đa của con đường dẫn đến các thành phố tương tự.
Input
Các đầu vào bắt đầu với T - số trường hợp thử nghiệm. Sau đó kiểm tra T theo. Trong mỗi bài kiểm tra:
. • Dòng đầu tiên là số nguyên n (1 ≤ n ≤ 500), mà là số của các thành phố nhãn từ 1 đến n
• Dòng thứ hai là một m số nguyên (0 ≤ m ≤ 2500), đó là số lượng đường.
• các dòng m tiếp theo mô tả các con đường. Mỗi con đường được mô tả bằng hai số nguyên a và b (1 ≤ a, b ≤ n, a <> b) chỉ ra một con đường giữa thành phố a và b.
Output
Với mỗi test, in một dòng số lượng tối đa của con đường dẫn đến sự cùng một thành phố.
đang được dịch, vui lòng đợi..