You have an array. Someone asks you: "What's the sum from index 3 to index 7?" Easy, you loop and add. But what if they ask such questions? Looping each time gives you where is the number of queries.
With and , that's billion operations. Your program times out. By the end, you'll answer each query in time after a single preprocessing step. The technique is called prefix sums.