{"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\"\u003eThis is a simple problem. The teacher gives Bob a list of problems about GCD (Greatest Common Divisor). After studying some of them, Bob thinks that GCD is so interesting. One day, he comes up with a new problem about GCD. Easy as it looks, Bob cannot figure it out himself. Now he turns to you for help, and here is the problem:\u003cbr\u003e\u0026nbsp;\u0026nbsp;\u003cbr\u003e\u0026nbsp;\u0026nbsp;Given an array $a$ of $N$ positive integers $a_1, a_2, \\cdots a_{N-1}, a_N$; a subarray of $a$ is defined as a continuous interval between $a_1$ and $a_N$. In other words, $a_i, a_{i+1}, \\cdots, a_{j-1}, a_j$ is a subarray of $a$, for $1\\le i\\le j\\le N$. For a query in the form $(L, R)$, tell the number of different GCDs contributed by all subarrays of the interval $[L, R]$.\u003cbr\u003e\u0026nbsp;\u0026nbsp;\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"There are several tests, process till the end of input.\u003cbr\u003e\u0026nbsp;\u0026nbsp;\u003cbr\u003e\u0026nbsp;\u0026nbsp;For each test, the first line consists of two integers $N$ and $Q$, denoting the length of the array and the number of queries, respectively. $N$ positive integers are listed in the second line, followed by $Q$ lines each containing two integers $L,R$ for a query.\u003cbr\u003e\u003cbr\u003eYou can assume that \u003cbr\u003e\u0026nbsp;\u0026nbsp;\u003cbr\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;$1\\le N,Q\\le100000$ \u003cbr\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u003cbr\u003e\u0026nbsp;\u0026nbsp; $1\\le a_i\\le1000000$"}},{"title":"Output","value":{"format":"HTML","content":"For each query, output the answer in one line."}},{"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\u003e5 3\r\n1 3 4 6 9\r\n3 5\r\n2 5\r\n1 5\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e6\r\n6\r\n6\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}