eolymp
bolt
Try our new interface for solving problems
Problems

Crime scene

Crime scene

Crew members located the traitor's crime scene. Now the ship's crew wants to secure this crime scene.

The crime scene looks like a convex polygon A. The crew of the ship wants to enclose it with another convex polygon B. Moreover, B must have the minimum possible number of vertices. And all the vertices of polygon A must lie on the boundary of polygon B.

Help the team to choose such polygon B.

Input

The first line contains one integer t (1t1000) - the number of test cases. The following is a description of the t test cases.

The first line of each test contains one integer n (3n100) - the number of vertices in polygon A.

The next n lines contain two integers xi and yi the coordinates of the i-th vertex of the polygon (|xi|, |yi| ≤ 1000). The vertices of the polygon are given in counterclockwise order. It is guaranteed that the polygon is strictly convex. That is, no three of its consecutive vertices lie on the same straight line.

Output

For each test, first print one integer m - the number of vertices in the found polygon B.

In the next m lines print two real numbers xi and yi each, the coordinates of the i-th vertex of the polygon. Output polygon vertices in counterclockwise order. The resulting polygon must be strictly convex. Also, all vertices of the source polygon must be at a distance of no more than 10-6 from the border of the output polygon.

Time limit 1 second
Memory limit 128 MiB
Input example #1
3
3
1 0
1 1
0 1
4
0 0
1 0
1 1
0 1
5
1 0
3 0
3 2
1 2
0 1
Output example #1
3
1.000000000000000 0.000000000000000
1.000000000000000 1.000000000000000
0.000000000000000 1.000000000000000
3
0.000000000000000 0.000000000000000
2.000000000000000 0.000000000000000
0.000000000000000 2.000000000000000
3
3.000000000000000 0.000000000000000
3.000000000000000 4.000000000000000
-1.000000000000000 -0.000000000000000
Source 2020 Cycle of Internet Olympiads for schoolchildren, Second team contest, Advanced level, October 25, Problem G