You are given an undirected tree consisting of $$$n$$$ vertices. A simple path $$$p$$$ of length $$$k$$$ is defined as a sequence of distinct vertices $$$p_0,p_1,\ldots,p_k$$$ such that there exists an undirected edge between vertices $$$p_i$$$ and $$$p_{i+1}$$$ for every $$$0 \le i \lt k$$$. A simple path is uniquely identified by the unordered pair of its endpoints, $$$(p_0,p_k)$$$. That is, $$$(u,v)$$$ and $$$(v,u)$$$ represent the same simple path.
Tom and Jerry are playing a game on this tree. The players take turns, with Tom going first. In the $$$i$$$-th turn ($$$i \ge 1$$$), the current player chooses a simple path $$$(x_i,y_i)$$$ that satisfies the following conditions:
The player who is unable to choose a valid path on their turn loses the game.
Assuming both Tom and Jerry play optimally, your task is to compute the total number of distinct simple paths Tom can choose in the first turn such that he can guarantee a win.
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 10^4$$$). The description of the test cases follows.
The first line of each test case contains an integer $$$n$$$ ($$$2 \le n \le 2 \cdot 10^5$$$), representing the number of vertices in the tree.
Each of the next $$$n-1$$$ lines contains two integers $$$u$$$ and $$$v$$$ ($$$1 \le u,v \le n$$$, $$$u \ne v$$$), representing an undirected edge between vertices $$$u$$$ and $$$v$$$. It is guaranteed that the edges form a valid tree.
It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$2 \cdot 10^5$$$.
For each test case, output an integer representing the total number of distinct simple paths Tom can choose in the first turn such that he can guarantee a win.
521 231 22 351 22 32 42 551 22 33 44 571 22 32 44 55 65 7
11615
In the first test case, the tree consists of only two vertices and a single edge between vertex $$$1$$$ and vertex $$$2$$$. Tom can choose the simple path $$$(1,2)$$$ on his first turn. Since this path consumes the only edge in the tree, Jerry will have no unused edges available to form a valid path on his turn. Thus, Jerry is unable to make a move, and Tom wins the game. There is exactly $$$1$$$ winning path for Tom.
In the third test case, the tree is a star graph with vertex $$$2$$$ at the center, connected to vertices $$$1, 3, 4,$$$ and $$$5$$$. There are $$$10$$$ possible simple paths in total.
One of the winning paths is $$$(1,3)$$$:
One of the losing paths is $$$(1,2)$$$:
| Name |
|---|


