Something About Divisors
All submissions for this problem are available.
For a given positive integers B and X find the number of positive integers N such that number N*X has at least one divisor D such that N < D <= B.
The first line contains a single positive integer T <= 40, the number of test cases. T test cases follow. The only line of each test case contains two positive integers B <= 1012 and X <= 60.
For each test case, output a single line containing the answer for the corresponding test case.
Input: 3 5 1 10 3 100 6 Output: 0 5 63
In the second test case required numbers are 1, 2, 3, 4, 6.
|Tags||anton_lunyov, aug11, hard|
|Time Limit:||0.869142 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, SCALA, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, PERL6, TEXT, PYP3, CLOJ, FS|
Fetching successful submissions
If you are still having problems, see a sample solution here.