Let's place a robot in some vertex , and suppose we initially have coins. Consider the following process, where in the -th step (starting from ):
If is odd, the robot moves to an adjacent vertex in the direction of vertex ;
Else, is even. You can either pay one coin (if there are some left) and then the robot moves to an adjacent vertex in the direction of vertex , or not pay, and then the robot moves to an adjacent vertex chosen uniformly at random.
The process stops as soon as the robot reaches vertex . Let be the minimum possible expected number of steps in the process above if we spend our coins optimally.
Answer queries, in the -th of which you have to find the value of , modulo .
Formally, let . It can be shown that the answer can be expressed as an irreducible fraction , where and are integers and . Output the integer equal to . In other words, output such an integer that and .
输入格式
Each test contains multiple test cases. The first line contains the number of test cases ( ). The description of the test cases follows.
The first line of each test case contains two integers and ( ; ) — the number of vertices in the tree and the number of queries.
The next lines contain the edges of the tree, one edge per line. The -th line contains two integers and ( ; ), denoting the edge between the nodes and .
The next lines contain two integers and ( ; ).
It's guaranteed that the given edges form a tree.
It is guaranteed that the sum of over all test cases does not exceed .
It is guaranteed that the sum of over all test cases does not exceed .
输出格式
For each test case, print integers: the values of modulo .
Formally, let . It can be shown that the answer can be expressed as an irreducible fraction , where and are integers and . Output the integer equal to . In other words, output such an integer that and .