#P6027. 轴对称

轴对称

Description

Little W thinks axial symmetry transformations are really fun, so he randomly picked nn points A1,A2,,AnA_1,A_2,\cdots,A_n on the plane, and then performed a series of axial symmetry transformations to obtain nn points B1,B2,,BnB_1,B_2,\cdots,B_n, where A1A_1 becomes B1B_1, and so on.

However, he suddenly forgot how he transformed them, so he asks you to help him find a valid sequence of transformations with as few steps as possible.

Input Format

The first line contains an integer nn, the number of points.

The next nn lines, line i+1i+1 contains two real numbers x,yx,y, representing the xx- and yy-coordinates of AiA_i.

The next nn lines, line i+n+1i+n+1 contains two real numbers x,yx,y, representing the xx- and yy-coordinates of BiB_i.

Output Format

The first line contains an integer kk, the minimum number of steps.

The next kk lines, line i+1i+1 contains three real numbers A,B,CA,B,C, indicating that the axis of the ii-th axial symmetry transformation is the line Ax+By+C=0Ax+By+C=0.

2
1.000000 1.000000
2.000000 2.000000
4.000000 4.000000
3.000000 3.000000

1
1.000000 1.000000 -5.000000

Hint

Sample Explanation

Hint

For the line Ax+By+C=0Ax+By+C=0, if BB is non-zero, then it is the graph of the linear function y=ABxCBy=-\dfrac ABx-\dfrac CB; otherwise, it represents a line perpendicular to the xx-axis, namely x=CAx=-\dfrac CA.

This problem uses an SPJ\text{SPJ}. For some reason, this problem does not provide the SPJ\text{SPJ} to contestants.

For each test case, if your kk is correct, you will get 30%30\% of the score.

Next, we will apply your kk axial symmetry transformations to A1,A2,,AnA_1,A_2,\cdots,A_n respectively, and let the resulting point of AiA_i be CiC_i. If for all ii, the absolute differences between the x,yx,y coordinates of BiB_i and CiC_i are both no more than 10210^{-2}, then you will get 100%100\% of the score.

If you only want to output kk, please also output some arbitrary values afterwards to avoid UKE\text{UKE}.

Constraints

Test Point ID n=n= Number of folds used when constructing the testdata
1,2 11 1\le1
3,4 22 10\le10
5,6 55 103\le10^3
7,8,9,10 1010 105\le10^5

For all data, 1n101\le n\le10, x,y105|x|,|y|\le 10^5.

All data points have been verified by the SPJ\text{SPJ} and are correct.

Please ensure that all A,B,CA,B,C in your output satisfy A,B,C105|A|,|B|,|C|\le 10^5.

Translated by ChatGPT 5