{"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\"\u003eRikka and Yuta are interested in Phi function (which is known as Euler\u0027s totient function).\u003cbr\u003e\u003cbr\u003eYuta gives Rikka an array $A[1..n]$ of positive integers, then Yuta makes $m$ queries. \u003cbr\u003e\u003cbr\u003eThere are three types of queries: \u003cbr\u003e\u003cbr\u003e$ 1 \\; l \\; r $ \u003cbr\u003e\u003cbr\u003eChange $A[i]$ into $\\varphi(A[i])$, for all $i \\in [l, r]$.\u003cbr\u003e\u003cbr\u003e$ 2 \\; l \\; r \\; x$ \u003cbr\u003e\u003cbr\u003eChange $A[i]$ into $x$, for all $i \\in [l, r]$.\u003cbr\u003e\u003cbr\u003e$ 3 \\; l \\; r $ \u003cbr\u003e\u003cbr\u003eSum up $A[i]$, for all $i \\in [l, r]$.\u003cbr\u003e\u003cbr\u003eHelp Rikka by computing the results of queries of type 3.\u003cbr\u003e\u003cbr\u003e\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"The first line contains a number $T(T \\leq 100)$ ——The number of the testcases. And there are no more than 2 testcases with $n \u0026gt; 10 ^ 5$\u003cbr\u003e\u003cbr\u003eFor each testcase, the first line contains two numbers $n,m(n \\leq 3 \\times 10^5, m \\leq 3 \\times 10^5)$。\u003cbr\u003e\u003cbr\u003eThe second line contains $n$ numbers $A[i]$\u003cbr\u003e\u003cbr\u003eEach of the next $m$ lines contains the description of the query. \u003cbr\u003e\u003cbr\u003eIt is guaranteed that $1 \\leq A[i] \\leq 10^7$ At any moment."}},{"title":"Output","value":{"format":"HTML","content":"For each query of type 3, print one number which represents the answer."}},{"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\n10 10\r\n56 90 33 70 91 69 41 22 77 45\r\n1 3 9\r\n1 1 10\r\n3 3 8\r\n2 5 6 74\r\n1 1 8\r\n3 1 9\r\n1 2 10\r\n1 4 9\r\n2 8 8 69\r\n3 3 9\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e80\r\n122\r\n86\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}