직사각형을 채우는 n개 정사각형의 왼쪽 아래 꼭짓점이 주어질 때, 각 정사각형의 한 변의 길이를 구하거나 해가 없음을 판정한다.
보통7기하정렬구현아직 제출이 없습니다시간 제한2초메모리 제한128 MBAs 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 n 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 n left lower corners, find n squares with sides parallel to axes, such that:
The first line of the input contains a single integer t (1≤t≤50) -- the number of test cases in the input. Next, t descriptions of test cases follow.
The first line of a test case contains a single integer n (1≤n≤2000) -- the number of points. The next n lines contain two integers each, x_i,y_i (0≤x_i,y_i≤109) -- the coordinates of the i-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 5000.
For each of t 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, n positive integers; the i-th of these numbers should denote the length of a side of the i-th square in the solution. This number should not exceed 2⋅109. 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 2⋅109. If there exist multiple solutions, you can output any of them.