Symmetry: Tree

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

문제

Given a tree with nn vertices, for each node i=1,2,,ni = 1, 2, \ldots, n, find an integer point p_i=(x_i,y_i)p\_i = (x\_i, y\_i), and then, for each edge (u,v)(u, v), connect points p_up\_u and p_vp\_v with a line segment, so that the following conditions hold:

  1. No two points coincide.
  2. No two line segments have common points except at both endpoints.
  3. There exists a line such that the shape formed by the points is symmetric about the line and the shape formed by the line segments is symmetric about the line.

입력

There are multiple test cases. The first line of input contains an integer TT (1T1031\le T\le 10^3), the number of test cases. For each test case:

The first line contains an integer nn (1n1031 \le n \le 10^3), the number of vertices of the tree.

Each of the following n1n-1 lines contains two integers uu and vv (1u,vn1\le u, v\le n, uvu \ne v), denoting an edge connecting uu and vv.

Note that there are no constraints related to the sum of nn.

출력

For each test case:

If there is no answer, output the word "NO" on the only line.

Otherwise, output "YES" on the first line, and two integers x_ix\_i and y_iy\_i (0x_i,y_in0\le |x\_i|, |y\_i| \le n) in the ii-th of the following nn lines.

After that, output another line with three integers aa, bb, cc (0a0\le |a|, b|b|, cn|c|\le n), denoting that the shapes are symmetric about the ax+by+c=0ax+by+c=0.

If there are multiple answers, output any one of them.