FCDC  Factorial Modulo
You are given 2 integers a, b. Find the number of i for which i! is divisble by a but not b. if i! is divisible by a and b, then you should not count that i.
Input
One line that contains a and b.
Output
Output the result in one line.
Example
Input: 2 3 Output: 1
Constraints
1 ≤ a ≤ b ≤ 10^{7}
Explanation
2! is the only factorial which is divisible by 2 and not divisible by 3.
hide comments
changyouren:
20210927 03:55:30
your answer should not be negative 

sankalp_7:
20210626 11:23:40
Factorization + Binary search


tanardi gunawan:
20190209 16:40:31
good problem 

akjol2049:
20181122 16:29:22
nice problem..enjoyed solving it.Thanks Ruhan! 

puneethnaik:
20180820 09:10:30
did it using binary search and highest power of a prime in n!. Enjoyed the problem. Hope it helps someone in need. All the best!!! 

eagleshadow:
20180701 17:06:34
AC in 10 min :)


mag1x_:
20180526 11:46:44
Factorization and brain storming :) 

excel_blaze:
20180518 22:43:37
that's a easy one :)


holmesherlock:
20171024 16:53:15
dont think too much,,simple logic will get you through


nadstratosfer:
20171020 06:04:48
Seemed easy but took me good 2 hours to crack. The implementation is not so straightforward either  my code came out quite bloated  but considering half of C submissions are slower than my Python3 one, you can probably bruteforce in a few lines also. 
Added by:  Ruhan Habib 
Date:  20151105 
Time limit:  1s 
Source limit:  50000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  All except: ASM64 GOSU JSMONKEY 
Resource:  Own Problem 