In August 2015, coach Fegla was visiting Syria for a training camp in AAST, Lattakia Branch, as Noura and Fegla are very close friends, she asked him whether her brother Tamim can attend the camp since he has been a contestant for a year. Tamim was very interested in the coach's topics. One day, Tamim was trying to implement a binary tree drawing software, he asked the coach for some hints, and the coach suggested the following technique:
Given a rooted full binary tree (each node, except the leaves, has exactly two children nodes), the program must draw a tree where the nodes are circles with radius r, and the center of the root is located at (0, 0).
The drawn tree should satisfy the following conditions:
The first line of input contains an integer T (1 ≤ T ≤ 64), the number of test cases.
The first line of each test case contains two integers N and q (1 ≤ N, q ≤ 105), the number of nodes and the number of queries. Each of the following N lines contains
.
For each test case, print q lines, each line should contain the coordinates of the given node U rounded to 4 decimal places.
1
9 4
2 4 5
2 6 7
2 1 2
0
0
2 9 8
0
0
0
1 2 1 2
1 2 1 9
2 2 2 5
2 2 2 7
4.1250 -4.0000
0.3750 -12.0000
-5.2500 -12.0000
12.7500 -12.0000
Warning: large Input/Output data, be careful with certain languages.
| Name |
|---|


