{"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":"HTML","content":"\u003chtml\u003e\n \u003chead\u003e\u003c/head\u003e\n \u003cbody\u003e\n \u003cdiv id\u003d\"problem-body\"\u003e \n \u003cp\u003eDhruba Vai wants to look at an array.\u003c/p\u003e \n \u003cp\u003eHe has given you a list of\u0026nbsp;\u003cstrong\u003eN\u0026nbsp;\u003c/strong\u003enumbers and\u0026nbsp;\u003cstrong\u003eQ\u0026nbsp;\u003c/strong\u003equeries. Each query is specified by two numbers\u0026nbsp;\u003cem\u003ei\u0026nbsp;\u003c/em\u003eand\u0026nbsp;\u003cem\u003ej\u003c/em\u003e; the answer to each query is the sum of every number between the range [i, j] (inclusive).\u003c/p\u003e \n \u003cp\u003e\u003cem\u003eNote:\u0026nbsp;\u003c/em\u003ethe query ranges are specified using 0-based indexing.\u003c/p\u003e \n \u003ch3\u003eInput\u003c/h3\u003e \n \u003cp\u003eThe first line contains\u0026nbsp;\u003cstrong\u003eN\u003c/strong\u003e, the number of integers in our list (\u003cstrong\u003eN \u0026lt;\u003d 100,000\u003c/strong\u003e). The next line holds\u0026nbsp;\u003cstrong\u003eN\u003c/strong\u003e\u0026nbsp;numbers that are guaranteed to fit inside an integer. Following the list is a number\u0026nbsp;\u003cstrong\u003eQ\u0026nbsp;\u003c/strong\u003e(\u003cstrong\u003eQ \u0026lt;\u003d 10,000\u003c/strong\u003e). The next\u0026nbsp;\u003cstrong\u003eQ\u003c/strong\u003e\u0026nbsp;lines each contain two numbers\u0026nbsp;\u003cstrong\u003ei\u003c/strong\u003e\u0026nbsp;and\u0026nbsp;\u003cstrong\u003ej\u0026nbsp;\u003c/strong\u003ewhich specify a query you must answer (\u003cstrong\u003e0 \u0026lt;\u003d i, j \u0026lt;\u003d N-1\u003c/strong\u003e).\u003c/p\u003e \n \u003ch3\u003eOutput\u003c/h3\u003e \n \u003cp\u003eFor each query, output the answer to that query on its own line in the order the queries were made.\u003c/p\u003e \n \u003ch3\u003eExample\u003c/h3\u003e \n \u003cpre\u003e\u003cstrong\u003eInput:\u003c/strong\u003e\n3\u003cbr\u003e1 4 1\u003cbr\u003e3\u003cbr\u003e1 1\u003cbr\u003e1 2\u003cbr\u003e0 2\u003c/pre\u003e \n \u003cpre\u003e\u003cstrong\u003eOutput:\u003c/strong\u003e\n4\u003cbr\u003e5\u003cbr\u003e6\u003c/pre\u003e \n \u003c/div\u003e\n \u003c/body\u003e\n\u003c/html\u003e"}}]}