Friends#10947

Friends

1 Sekunde
128 Megabyte
Leicht

There is a town with citizens. It is known that some pairs of people are friends. According to the famous saying that "The friends of my friends are my friends, too" it follows that if and are friends and and are friends then and are friends, too.

Your task is to count how many people there are in the largest group of friends.

Eingabe

Consists of several datasets. The first line consists of a line with the number of test cases to follow. The first line of each dataset contains two numbers and , where n~(1 \le n \le 30000) — the number of town's citizens and m~(0 \le m \le 500000) — the number of pairs of people, which are known to be friends. Each of the following lines consists of two integers and b~(1 \le a \le n, 1 \le b \le n, a \ne b) which describe that and are friends. There could be repetitions among the given pairs.

Ausgabe

The output for each test case should contain one number denoting how many people there are in the largest group of friends on a line by itself.

Beispiele

Beispiel 1

Loading
Loading