{"trustable":false,"prependHtml":"\u003cstyle type\u003d\"text/css\"\u003e\n #problem-body \u003e pre {\n display: block;\n padding: 9.5px;\n margin: 0 0 10px;\n font-size: 13px;\n line-height: 1.42857143;\n word-break: break-all;\n word-wrap: break-word;\n color: #333;\n background: rgba(255, 255, 255, 0.5);\n border: 1px solid #ccc;\n border-radius: 6px;\n }\n\u003c/style\u003e\n","sections":[{"title":"","value":{"format":"MD","content":"You are given a sequence $A$ of $N (N\\leq 100,000)$ positive integers. There sum will be less than $10^{18}$. On this sequence you have to apply $M (M\\leq 100,000)$ operations:\n\n1. For given $x, y$, for each elements between the $x^{th}$ and the $y^{th}$ ones (inclusively, counting from 1), modify it to its positive square root (rounded down to the nearest integer).\n2. For given $x, y$, query the sum of all the elements between the $x^{th}$ and the $y^{th}$ ones (inclusively, counting from 1) in the sequence."}},{"title":"Input","value":{"format":"MD","content":"Multiple test cases, please proceed them one by one. Input terminates by EOF.\n\nFor each test case:\nThe first line contains an integer $N$. The following line contains $N$ integers, representing the sequence $A_1, A_2, ..., A_N$.\nThe third line contains an integer $M$. The next $M$ lines contain the operations in the form $\\textit{i x y}$. $i\u003d0$ denotes the modify operation, $i\u003d1$ denotes the query operation.\u003c/p\u003e"}},{"title":"Output","value":{"format":"MD","content":"For each test case:\n\nOutput the case number (counting from 1) in the first line of output. Then for each query, print an integer as the problem required.\nPrint an blank line after each test case.\nSee the sample output for more details."}},{"title":"Sample I/O","value":{"format":"MD","content":"\u003ctable class\u003d\"vjudge_sample\"\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\u003e\n5\n1 2 3 4 5\n5\n1 2 4\n0 2 4\n1 2 4\n0 4 5\n1 1 5\n4\n10 10 10 10\n3\n1 1 4\n0 2 3\n1 1 4\n\u003c/pre\u003e\u003c/td\u003e\n\u003ctd\u003e\u003cpre\u003e\nCase #1:\n9\n4\n6\n\nCase #2:\n40\n26\n\u003c/pre\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}