Do you think that drawing polygons is easy? This is not the case when you have some restrictions.
In this problem all you have to do is just to draw a polygon. It must have exactly N vertices. It must contain no self-intersections. No three consecutive vertices of the polygon must be collinear. All coordinates of its vertices must be integers between 0 and 10 000, inclusive. Easy, right?
There is one more small restriction though. The number of inner angles of this polygon equal to 90° must be as large as possible under these constraints. What do you think about it now?
Contains the number of test cases T (1 ≤ T ≤ 30) followed by T integer numbers N (3 ≤ N ≤ 1000).
For each test case print the maximum possible number of inner angles equal to 90° followed by N pairs of integers -the coordinates of the vertices of the polygon in either clockwise or counterclockwise order. Of course, more than one solution is possible, so output any of them.