Adding Least Common Multiples
All submissions for this problem are available.
Given A and B, compute the sum of lcm(a, b) over all pairs of positive integers a and b such that:
(1) a<=A and b<=B.
(2) There is no integer n>1 such that n2 divides both a and b.
Give your answer modulo 230.
The first line contains the number of test cases, t (about 200). Each of the next t lines contains two space-separated integers A and B (1<=A, B<=4000000).
Print the answer to each test case on a separate line.
Input: 4 2 4 3 3 6 5 8 3 Output: 24 28 233 178
|Tags||MichaelD, hard, july10|
|Time Limit:||0.179775 sec|
|Source Limit:||50000 Bytes|
|Languages:||ADA, ASM, BASH, BF, C, C99 strict, CAML, CLOJ, CLPS, COB, CPP 4.3.2, CPP 6.3, CPP14, CS2, D, ERL, FORT, FS, GO, HASK, ICK, ICON, JAVA, JS, kotlin, LISP clisp, LISP sbcl, LUA, NEM, NICE, NODEJS, PAS fpc, PAS gpc, PERL, PERL6, PHP, PIKE, PRLG, PYPY, PYTH, PYTH 3.5, RUBY, rust, SCALA, SCM chicken, SCM guile, SCM qobi, ST, swift, TEXT, WSPC|
Fetching successful submissions
If you are still having problems, see a sample solution here.