Jellyfish

아직 제출이 없습니다시간 제한2초메모리 제한512 MB

문제

Everyone knows that at Jagiellonian University we do love plants a lot. We created hundreds of problems about trees, forests and even cacti! Unfortunately, problems about animals are not that popular. Today we want to prove that we love animals as well.

We say that a graph is a jellyfish, if it is a simple connected undirected graph with equal number of vertices and edges. You are given a jellyfish JJ with nn vertices. For an arbitrary subset of vertices SJS \subseteq J, we say that SS is an awesome subset if for every TST \subseteq S there exists a connected subgraph of the jellyfish which contains every vertex from TT and does not contain any other vertex from SS.

What is the maximum possible size of an awesome subset of JJ?

입력

The first line of input contains the number of test cases zz. The descriptions of the test cases follow.

The first line of each test case contains one integer nn (3n100,0003 \leq n \leq 100\\,000) -- the number of vertices of the jellyfish.

The next nn lines contain two integers u_iu\_i, v_iv\_i (1u_iv_in1 \leq u\_i \neq v\_i \leq n) each, corresponding to the jellyfish edges. It is guaranteed that the given graph is a jellyfish, and every two vertices are connected by at most one edge.

The total number of vertices in all test cases does not exceed 10610^6.

출력

For each test case, output a single line which contains a single integer -- the maximum possible size of an awesome subset of the jellyfish.