#P12816. [NERC 2021] Connect the Points
[NERC 2021] Connect the Points
题目描述
You are given three points on a plane. You should choose some segments on the plane that are parallel to coordinate axes, so that all three points become connected. The total length of the chosen segments should be the minimal possible.
Two points and are considered connected if there is a sequence of points such that points and lie on the same segment.
输入格式
The input consists of three lines describing three points. Each line contains two integers and separated by a space --- the coordinates of the point (). The points are pairwise distinct.
输出格式
On the first line output --- the number of segments, at most 100.
The next lines should contain descriptions of segments. Output four integers , , , on a line --- the coordinates of the endpoints of the corresponding segment (). Each segment should be either horizontal or vertical.
It is guaranteed that the solution with the given constraints exists.
1 1
3 5
8 6
3
1 1 1 5
1 5 8 5
8 5 8 6
提示
The points and the segments from the example are shown below.