{"trustable":true,"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":"\u003cdiv class\u003d\"panel_content\"\u003e$Touma Kazusa$ is dating with $Kitahara Haruki$. To test if $Haruki$ is a skilled man, $Kazusa$ created a function which called $Kazusa$ $function $. Its expression is as follows: \u003cbr\u003e\u003cbr\u003e$S(l,r) \u003d \\sum_{i\u003dl}^{r}\\sum_{j\u003dl}^{r}\\varphi(gcd(a_i,a_j))lcm(a_i,a_j)$ .$l$ and $r$ are the left and right endpoints of an interval of sequence $a$, respectively.\u003cbr\u003e\u003cbr\u003eHowever, because this function is really easy for $Haruki$ and $Haruki$ told $Kazusa$ the answer quickly. So $Kazusa$ strengthened the problem. \u003cbr\u003e\u003cbr\u003eNow, $Kazusa$ will gives $Haruki$ a sequence $a$ and $q$ intervals, and for each interval, $Haruki$ should calculate $S(l,r)$.$Haruki$ still thinks it\u0027s easy for him, but he just want to date with $Kazusa$, So this problem should solved by you.\u003cbr\u003e\u003cbr\u003eBecause the value of $S(l,r)$ maybe too large, you only need output $S(l,r)$ $mod$ $2^{32}$\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"There are multiple test cases. The first line of the input contain an integer $T(1 \\leq T \\leq 100)$, indicating the number of test cases. For each test case:\u003cbr\u003e\u003cbr\u003eFirst line contains two positive integers $n(1 \\leq n \\leq 1e5)$ and $q(1 \\leq q \\leq 1e5)$ which are separated by spaces, denoting the length of sequence $a$ and the number of interval.\u003cbr\u003e\u003cbr\u003eSecond line contains $n$ positive integers $a_1$,$a_2$,$a_3$,...,$a_n$$(1\\leq a_i\\leq 1e7)$.\u003cbr\u003e\u003cbr\u003eFollowing $q$ lines, each line contain two integers $l, r$.$(1 \\leq l \\leq r \\leq n)$\u003cbr\u003e\u003cbr\u003eIt is guaranteed that $\\sum_{n} \\leq 3e5$ and $\\sum_{q} \\leq 3e5$, and at most two cases $n \u003d 1e5$. When $n \u003d 1e5$,it is guaranteed that all $a_i$ are generated randomly.\u003cbr\u003e"}},{"title":"Output","value":{"format":"HTML","content":"Output $q$ lines, each line is an integer, representing the value of $S(l,r)$ $mod$ $2^{32}$."}},{"title":"Sample","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e1\r\n5 1\r\n1 2 3 4 5\r\n1 5\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e199\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}