{"trustable":true,"sections":[{"title":"","value":{"format":"MD","content":"You have to find the number of solutions of the following equation:\n\n$$Ax + By + C \u003d 0$$\n\nWhere **A, B, C, x, y** are integers and **x\u003csub\u003e1\u003c/sub\u003e \u0026le; x \u0026le; x\u003csub\u003e2\u003c/sub\u003e** and **y\u003csub\u003e1\u003c/sub\u003e \u0026le; y \u0026le; y\u003csub\u003e2\u003c/sub\u003e**."}},{"title":"Input","value":{"format":"MD","content":"Input starts with an integer **T (\u0026le; 10000)**, denoting the number of test cases.\n\nEach case starts with a line containing seven integers **A, B, C, x\u003csub\u003e1\u003c/sub\u003e, x\u003csub\u003e2\u003c/sub\u003e, y\u003csub\u003e1\u003c/sub\u003e, y\u003csub\u003e2\u003c/sub\u003e** (**x\u003csub\u003e1\u003c/sub\u003e \u0026le; x\u003csub\u003e2\u003c/sub\u003e, y\u003csub\u003e1\u003c/sub\u003e \u0026le; y\u003csub\u003e2\u003c/sub\u003e**). The value of each integer will lie in the range **[-10\u003csup\u003e8\u003c/sup\u003e, 10\u003csup\u003e8\u003c/sup\u003e]**."}},{"title":"Output","value":{"format":"MD","content":"For each case, print the case number and the total number of solutions."}},{"title":"Sample","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e5\n1 1 -5 -5 10 2 4\n-10 -8 80 -100 100 -90 90\n2 3 -4 1 7 0 8\n-2 -3 6 -2 5 -10 5\n1 8 -32 0 0 1 10\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eCase 1: 3\nCase 2: 37\nCase 3: 1\nCase 4: 2\nCase 5: 1\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}