#P9820. Chaos Begin
Chaos Begin
Chaos Begin
Problem Description
Long long ago, there were points on the 2D plane. The world keeps stable for a long time. However, it begins to be chaotic recently when another points appeared, where . And now, these points have already lost their identifiers. You are given these points in an arbitrary order, you need to figure out all the possible to help the world recover from chaos.
Input
The first line contains a single integer (), the number of test cases. For each test case: The first line of the input contains a single integer (), denoting the number of initial points. In the next lines, the -th line contains two integers and (), describing the coordinate of a current point. It is guaranteed that the x-coordinate and y-coordinate of each initial point are chosen uniformly at random from integers in , where is chosen in . The randomness condition does not apply to the sample test case, but your solution must pass the sample as well. It is also guaranteed that the sum of all is at most .
Output
For each test case, first output a single line containing an integer , denoting the number of possible . Then output lines, each line contains two integers and . It is guaranteed that , and when , you should print the answers in ascending order of , and then in ascending order of in case of a tie.
Sample Input
1
3
1 2
3 4
8 9
7 8
6 7
2 3
Sample Output
2
-5 -5
5 5
Source
2023“钉耙编程”中国大学生算法设计超级联赛(3)