Time Limit: 2 second(s) | Memory Limit: 32 MB |
You have to find the number of solutions of the following equation:
Ax + By + C = 0
Where A, B, C, x, y are integers and x_{1} ≤ x ≤ x_{2} and y_{1} ≤ y ≤ y_{2}.
Input starts with an integer T (≤ 10000), denoting the number of test cases.
Each case starts with a line containing seven integers A, B, C, x_{1}, x_{2}, y_{1}, y_{2} (x_{1} ≤ x_{2}, y_{1} ≤ y_{2}). The value of each integer will lie in the range [-10^{8}, 10^{8}].
For each case, print the case number and the total number of solutions.
Sample Input |
Output for Sample Input |
5 1 1 -5 -5 10 2 4 -10 -8 80 -100 100 -90 90 2 3 -4 1 7 0 8 -2 -3 6 -2 5 -10 5 1 8 -32 0 0 1 10 |
Case 1: 3 Case 2: 37 Case 3: 1 Case 4: 2 Case 5: 1 |
Developed and Maintained by
JANE ALAM JAN |
Copyright © 2012
LightOJ, Jane Alam Jan |