#1338
Unrated
The Final Level
스페셜 저지
시간 제한
3s
메모리 제한
512MB
제출
0
정답
0
맞힌 사람
0
정답 비율
0.0%

문제

Fiora is a game designer. Now she is designing the final level for her new game.

A level for this game is a labyrinth on a rectangular grid with lots of enemies. Player starts her game at the square (0,0)(0, 0) and her purpose is to get to the square (a,b)(a, b). Fiora has lots of ideas on how to put enemies, but she does not like designing labyrinths. She needs your help here.

Fiora is drawing levels in a special level editor which supports one basic block to design a labyrinth. This block is an L-shaped corner, consisting of two perpendicular rectangles 1×n1 \times n squares in size intersecting at 1×11 \times 1 square. It is possible to rotate this block in four ways. Blocks cannot intersect, but they can touch each other. Player can move through all the squares lying in any block. She can move between two squares if they are sharing a side, even if they are in different blocks.

Fiora wants to design the final level with the minimal possible number of blocks. Of course, it should be possible to move from square (0,0)(0, 0) to square (a,b)(a, b).

입력

The first line of the input consists of a single integer mm (1m1001 \le m \le 100) — the number of test cases. It is followed by mm test cases. Each test case is on a separate line and consists of three integers aa, bb, and nn (108a,b108-10^8 \le a, b \le 10^8; 2n1082 \le n \le 10^8) — aa is the coordinate of the final point along the horizontal axis, bb is the coordinate of the final point along the vertical axis, and nn is the size of the block. The final point is not same as the starting one (either a0a \ne 0 or b0b \ne 0).

출력

For each test case, in the first line print the minimal number kk of blocks you need. In the following kk lines print description of these blocks. Each L-shaped corner block is described by coordinates of two cells. Print coordinates of the end of its vertical rectangle, followed by coordinates of the end of its horizontal rectangle. Specify the coordinates of the ends that are opposite to the intersection of the rectangles. Note that the order of cells in the block description matters, since a change of the order results in a reflected block. Coordinates of each end should be printed with the coordinate along the horizontal axis first, followed by the coordinate along the vertical axis.

All coordinates in the output should not exceed 10910^9 by absolute value.

It is guaranteed that the total number of blocks in the correct output does not exceed 10510 ^ 5 for all test cases combined.

예제 입력 1

2
2 3 2
4 -1 3

예제 출력 1

2
1 1 0 0
1 2 2 3
2
0 0 2 -2
3 -3 5 -1
코드 제출

코드를 제출하려면 로그인이 필요합니다.

로그인
내 제출
제출 내역이 없습니다.
맞은 사람
아직 맞은 사람이 없습니다.
난이도 투표
Unrated0명 투표
로그인 후 AC 받으면 투표할 수 있습니다.
전체 제출
제출 내역이 없습니다.