Read problems statements in Mandarin chinese, Russian and Vietnamese as well. 

As usual, Tom is trying to catch Jerry. To accomplish this task, Tom hired $K$ other cats (Tom does not take part in the chase). Formally, they are in a graph $G$ with $N$ vertices and $M$ edges. Let's denote the set of vertices of $G$ by $V$. The graph has a special property: for each simple cycle containing at least four vertices, there is an edge which is not part of this cycle, but connects two distinct vertices on the cycle.

Jerry can only move along the edges of the graph, but arbitrarily fast. The cats don't have to follow the edges — they can use a helicopter to go to any vertices they want.

The process of catching Jerry happens in several rounds as follows:
In round $0$, the cats choose a set of vertices $X_{0} \subseteq V$ with $|X_{0}| ≤ K$; Jerry chooses a vertex $v_{0} \in V \setminus X_{0}$.
For each $i ≥ 0$, let's denote the set of vertices containing cats in round $i$ by $X_{i}$ and the vertex containing Jerry by $v_{i}$. In round $i+1$, the cats choose a subset $X_{i+1} \subseteq V$ with $|X_{i+1}| ≤ K$.
Afterwards in round $i+1$, Jerry must choose a vertex $v_{i+1} \in V \setminus X_{i+1}$ such that there is a path from $v_{i}$ to $v_{i+1}$ which doesn't pass through any vertex in $X_{i} \cap X_{i+1}$. If Jerry cannot choose such a vertex, the cats win.

If this process can last forever ($K$ cats are not enough to catch Jerry), then Jerry wins.

Your task is to calculate the minimum number of cats $K$ which Tom has to call in order to guarantee that Jerry will be caught (there is no winning strategy for Jerry).

------  Input ------
The first line of the input contains a single integer $T$ denoting the number of test cases. The description of $T$ test cases follows.
The first line of each test case contains two space-separated integers $N$ and $M$.
$M$ lines follow. Each of these lines contains two space-separated integers $u$ and $v$ denoting an edge between vertices $u$ and $v$.

------  Output ------
For each test case, print a single line containing one integer — the minimum number of cats needed to catch Jerry.

------  Constraints ------
$1 ≤ T ≤ 10$
$3 ≤ N ≤ 10^{5}$
$1 ≤ M ≤ 2\cdot 10^{5}$
$1 ≤ u, v ≤ N$
$u \neq v$
there is at most one edge between each pair of vertices

------  Subtasks ------
Subtask #1 (10 points): $3 ≤ N ≤ 30$

Subtask #2 (30 points): $3 ≤ N ≤ 100$

Subtask #3 (60 points): $T ≤ 5$

----- Sample Input 1 ------ 
2
7 6
1 2
1 3
2 4
2 5
3 6
3 7
4 6
1 2
1 3
1 4
2 3
2 4
3 4
----- Sample Output 1 ------ 
2
4
----- explanation 1 ------ 
Example case 2: Since $G$ is a complete graph, you need enough cats to cover all vertices, so the answer is $K=4$.

### Invalid Example

### Input

1
4 4
1 2
2 3
3 4
4 1

### Output

3

### Explanation
Note that this example is not valid, since the graph is a cycle with length $4$ and no additional edge. It was added just for further clarification of the chase.

Example case 1: The answer is $K=3$, since three cats can easily corner a mouse by confining it to one vertex, while 2 cats are not enough, because when one cat moves, the mouse can go anywhere without coming into contact with the only stationary cat.

Difficulty: VERY_HARD
Tags: Graph algorithms

Shortest paths

Starter code:

Solutions:
def max_clique(g):
	n = 0
	for x in g:
		n = max(n, len(x))
	l = [set() for _ in range(n + 1)]
	s = [0] * len(g)
	for (i, x) in enumerate(g):
		ll = len(x)
		l[ll].add(i)
		s[i] = ll
	m = 0
	for _ in range(len(g)):
		for i in range(n + 1):
			if len(l[i]) > 0:
				x = l[i].pop()
				m = max(m, i)
				s[x] = 0
				for k in g[x]:
					if s[k] > 0:
						l[s[k]].remove(k)
						s[k] -= 1
						l[s[k]].add(k)
				break
	return m + 1

def dfs(s, b, u):
	s.add(u)
	b[u] = True
	for v in g[u]:
		if b[v]:
			continue
		dfs(s, b, v)
for _ in range(int(input())):
	(n, m) = map(int, input().split())
	g = [list() for _ in range(n)]
	for _ in range(m):
		(u, v) = map(int, input().split())
		g[u - 1].append(v - 1)
		g[v - 1].append(u - 1)
	print(max_clique(g))