Alice and Bob like to play games on a tree with n vertices conveniently labeled with 1,2,…,n. They play a total of q games.
In game i, Alice starts at vertex a_i while Bob starts at a different vertex b_i. Initially, all vertices have no color except for the vertices a_i and b_i: vertex a_i is colored by Alice while vertex b_i is colored by Bob.
After that, the players take turns for k_i moves in total: Alice moves first, Bob moves second, then Alice makes the third move, and so on. In each move, the respective player moves to an adjacent vertex and colors it. Note that a vertex can be recolored: at any moment, each colored vertex has the color of the player who arrived there most recently.
Let the final number of vertices of Alice's color be A, and the final number of vertices of Bob's color be B. Alice would like to maximize the number (A−B), while Bob would like to minimize this number.
For each game, find the difference (A−B) if both players play optimally.
The input contains zero or more test cases, and is terminated by end-of-file. For each test case:
The first line contains two integers n and q (2≤n≤2⋅105, 1≤q≤2⋅105).
The i-th of the following (n−1) lines contains two integers u_i and v_i which denote an edge between vertices u_i and v_i (1≤u_i,v_i≤n). It is guaranteed that the input forms a tree.
The i-th of the last q lines contains three integers a_i, b_i and k_i (1≤a_i,b_i≤n, 1≤k_i≤2n, a_i=b_i). It is guaranteed that both the sum of all n and the sum of all q do not exceed 2⋅105.
For each test case, output an integer which denotes the difference.