Mosaic

직사각형을 채우는 n개 정사각형의 왼쪽 아래 꼭짓점이 주어질 때, 각 정사각형의 한 변의 길이를 구하거나 해가 없음을 판정한다.

보통7기하정렬구현아직 제출이 없습니다시간 제한2초메모리 제한128 MB

문제

As a result of an unfortunate coincidence (and a malicious bug in the university's system), Byton has an internship in an archaeologist workshop. He tries to reconstruct an ancient mosaic. He knows that originally it used to have a shape of a rectangle divided into nn square tiles, which could be of different sizes. Regrettably, it is neither known what were the dimensions of the rectangle, nor what were the lengths of sides of individual squares. The only things that have been deduced from the ancient texts are the positions of left lower corners of each square tile.

As it turns out, even archaeologists sometimes need help from programmers! Given input data about positions of nn left lower corners, find nn squares with sides parallel to axes, such that:

  • all squares comprise a rectangle,
  • no two squares overlap, that is, there are no points that belong to interior of more than one square,
  • the left lower corner of the ii-th square is equal to the ii-th point from the input.

입력

The first line of the input contains a single integer tt (1t501 \le t \le 50) -- the number of test cases in the input. Next, tt descriptions of test cases follow.

The first line of a test case contains a single integer nn (1n20001 \le n \le 2000) -- the number of points. The next nn lines contain two integers each, x_i,y_ix\_i, y\_i (0x_i,y_i1090 \le x\_i, y\_i \le 10^9) -- the coordinates of the ii-th point. The points in a single test case are pairwise distinct.

The total number of points in all test cases in a single input file does not exceed 50005000.

출력

For each of tt test cases in the input, print a single line. If for a given set, there is no correct composition of square tiles, print the word NO. Otherwise print YES and afterwards, nn positive integers; the ii-th of these numbers should denote the length of a side of the ii-th square in the solution. This number should not exceed 21092 \cdot 10^9. You can assume that if a test case has a solution, there exists an answer where every square tile's side has length at most 21092 \cdot 10^9. If there exist multiple solutions, you can output any of them.