## Another Contest 9 Problem 1 - Black Room Boy

View as PDF

Points: 3
Time limit: 1.0s
Memory limit: 256M

Problem type

Nick is inside a rectangular black room. He knows how far away he is from each of the room's four walls. What are the possible dimensions of the room?

#### Input Specification

The first line contains a single positive integer, , the number of test cases. test cases follow.

Each test case consists of a single line that contains four space-separated positive integers, through . These four integers represent how far Nick is from each of the four walls of the room.

#### Output Specification

Output the answers for the test cases in order. There should be no blank lines in your output.

The answer for a test case should take lines, where is the number of distinct room dimensions that are attainable. The first line should contain an integer ; then, the next lines should contain two space-separated integers and , indicating that a rectangular room of dimensions is attainable. These lines should be printed in increasing order of , tiebreaking in increasing order of .

#### Sample Input

2
1 1 1 1
1 2 3 4

#### Sample Output

1
2 2
5
3 7
4 6
5 5
6 4
7 3