{"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在遥远的星系中,有两个长度为n的整数序列a和b。\u003cbr\u003eb是1到n的静态排列。最初,a被填充为零。\u003cbr\u003e有两种操作:\u003cbr\u003e1. add l r:对$a_l,a_{l+1}...a_r$加一\u003cbr\u003e2. query l r:查询$\\sum_{i\u003dl}^r \\lfloor a_i / b_i \\rfloor$\u003c/div\u003e"}},{"title":"输入","value":{"format":"HTML","content":"有多个测试用例,请读取输入文件直至结尾。\u003cbr\u003e对于每个测试用例,在第一行,有两个整数n,q,表示a、b的长度和查询次数。\u003cbr\u003e在第二行,有n个用空格分隔的整数,表示排列b。\u003cbr\u003e在接下来的q行中,每行要么是\u0027add l r\u0027的形式,要么是\u0027query l r\u0027的形式,表示一次操作。\u003cbr\u003e$1 \\leq n,q \\leq 100000$,$1 \\leq l \\leq r \\leq n$,不会超过5个测试用例。\u003cbr\u003e"}},{"title":"输出","value":{"format":"HTML","content":"对于每个\u0027query\u0027,输出一个答案,每行一个。\u003cbr\u003e"}},{"title":"样例","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 12\r\n1 5 2 4 3\r\nadd 1 4\r\nquery 1 4\r\nadd 2 5\r\nquery 2 5\r\nadd 3 5\r\nquery 1 5\r\nadd 2 4\r\nquery 1 4\r\nadd 2 5\r\nquery 2 5\r\nadd 2 2\r\nquery 1 5\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e1\r\n1\r\n2\r\n4\r\n4\r\n6\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e"}}]}