Description:


There is an equation \(ax + by + c = 0\) . Given \(a,b,c,x_1,x_2,y_1,y_2\) you must determine, how many integer roots of this equation are satisfy to the following conditions : \(x_1\le x\le x_2\) , \(y_1\le y\le y_2\) . Integer root of this equation is a pair of integer numbers (x,y).

Input:


Input contains integer numbers \(a,b,c,x_1,x_2,y_1,y_2\) delimited by spaces and line breaks. All numbers are not greater than \(10^8\) by absolute value.

Output:


Write answer to the output.

Sample Input:


Sample Output:


题解:


SGU炸了一年终于好了,希望不要再坏掉。。。

题目大意:给定方程 \(ax+by+c=0\) ,求在 \([x_1, x_2], [y_1, y_2]\) 内有多少组解。

这个题可以很明显地看出是扩展欧几里得的题目,然而很多细节,去年我一直WA。。。。