CF710D Two Arithmetic Progressions
Description
You are given two arithmetic progressions: $ a_{1}k+b_{1} $ and $ a_{2}l+b_{2} $ . Find the number of integers $ x $ such that $ L
Input Format
The only line contains six integers $ a_{1},b_{1},a_{2},b_{2},L,R \, ( 0 \lt a_1,a_2 \le 2\times10^9,-2\times10^9 \le b_1,b_2,L,R \le 2\times10^9,L \le R)$ .
Output Format
Print the desired number of integers $ x $ .