{"trustable":false,"prependHtml":"\u003cscript\u003e window.katexOptions \u003d { disable: true }; \u003c/script\u003e\n\u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {\n inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027], [\u0027$\u0027,\u0027$\u0027]],\n displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027], [\u0027$$\u0027,\u0027$$\u0027]]\n }\n });\n\u003c/script\u003e\n\u003cscript async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS-MML_HTMLorMML\" type\u003d\"text/javascript\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"[1,n] 和 [1,m]中有多少对数的GCD的素因子个数小于等于p"}},{"title":"Input","value":{"format":"HTML","content":"The first line of input is an integer Q meaning that there are Q test cases. \n\u003cbr\u003eThen Q lines follow, each line is a test case and each test case contains three non-negative numbers: n, m and P (n, m, P \u0026lt;\u003d 5×10 \n\u003csup\u003e5\u003c/sup\u003e. Q \u0026lt;\u003d5000)."}},{"title":"Output","value":{"format":"HTML","content":"For each test case, print the number of pairs (a, b), which 1\u0026lt;\u003da\u0026lt;\u003dn , 1\u0026lt;\u003db\u0026lt;\u003dm, and gcd(a,b) is a lucky number of P."}},{"title":"Sample Input","value":{"format":"HTML","content":"\u003cpre\u003e2\n10 10 0\n10 10 1\u003c/pre\u003e"}},{"title":"Sample Output","value":{"format":"HTML","content":"\u003cpre\u003e63\n93\u003c/pre\u003e"}}]}