Quadratic Functions

All submissions for this problem are available.
f(x) and g(x) are two quadratic polynomials:
 f(x) = Ax^{2} + Bx + C
 g(x) = Dx^{2} + Ex + F
It is guaranteed that f(x) and g(x) do not intersect. That is, there is no real number r, such that f(r) = g(r).
You need to find a quadratic polynomial h(x) = Px^{2} + Qx + R such that the sum of areas under the curves f(x)  h(x) and g(x)  h(x) is minimized between integer points x = L and x = R.
Output this minimized sum of the areas of curves f(x)  h(x) and g(x)  h(x) from x = L and x = R. Print this number as a fraction U/V, where U and V are positive integers and gcd( U, V) = 1.
Input
 First line contains a single integer T  the total number of testcases.

Each testcase is described by 3 lines.
 The first line contains 3 spaceseparated integers A, B and C.
 The second line contains 3 spaceseparated integers D, E and F.
 The third line contains 2 spaceseparated integers L and R.
Output
For each testcase, print a single line containing the sum of areas as the required fraction.
Constraints
 1 ≤ T ≤ 10^{3}
 1 ≤ A, B, C, D, E, F ≤ 10^{3}
 10^{3} ≤ L ≤ R ≤ 10^{3}
 P, Q, R need to be real numbers.
Example
Sample Input 1 1 1 1 2 2 2 1 2 Sample Output 15/2
Author:  wittyceaser 
Tags  wittyceaser 
Date Added:  17122017 
Time Limit:  1 sec 
Source Limit:  50000 Bytes 
Languages:  C, CPP14, JAVA, PYTH, PYTH 3.5, PYPY 
Comments
 Please login at the top to post a comment.
SUCCESSFUL SUBMISSIONS
Fetching successful submissions
HELP
If you are still having problems, see a sample solution here. 