You have N subjects in a course and you are given following information about the subjects: Each subject has two integers start and end which represents the study time starting from start[i] to end[i] to each of the ith subject(1 ≤ i ≤ N) .
There are no two distinct subjects X and Y such that start[X]≤start[Y] and end[Y]≤end[X], which means that there is no subject whose studying interval is completely present inside the other subject studying interval. You are required to write a program to assign each subject a new interval of time such that all the N new intervals are assigned according to the following rules:
Input Format :
First line contains number of test cases T.
Each test case in it's first line contains N — the number of subjects.
Each of the next N lines contains information about one of the subject's studying interval — two integer numbers start and end.
Output Format :
Print the maximal possible length of an interval in an irreducible fraction p/q
Input Constraints :
1<=T<=10
1<=N<=105
0≤start[i]<end[i]≤106 for all i between 1 to N
Note
Data provided in the input file confirms to the conditions laid out in the problem statement that is there are no two distinct X and Y such that start[X] ≤ start[Y] and end[Y] ≤ end[X]. Also each interval can have maximum precision that can be computed.
.
For first test case N=3 , Samu has to form new intervals for 3 subjects . One of the possible solution can be :
Studying interval for first subject is given as [4,12] which can now be [7,12]
Studying interval for second is given as [2,8] which can now be [2,7]
Studying interval for third subject is given as [16,24] which can now be [16,21]
We can see all the new intervals satisfy the given rules.
For second test case N=3 , Samu has to form new intervals for 3 subjects . One of the possible solution can be :
Studying interval for first subject is given as [1,3] which can now be [1.5,3.0]
Studying interval for second is given as [0,2] which can now be [0,1.5]
Studying interval for third subject is given as [4,6] which can now be [4,5.5]
We can see all the new intervals satisfy the given rules.