Given a range [m..n]. You task is to find the number of integers divisible by either a or b in the given range.
The first line of input consists of an integer T denoting the number of test cases.The next line consists of four space seperated integers m, n, a, b where m and n denotes the range.
Print the number of integers divisible by a or b in the given range.
1 <= T <= 100
1 <= m,n <= 100000
1 <= a,b <= 500
5 11 4 6
3 1000 5 9
If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.