Given an array of integers and q queries, each query asks: what's the sum of elements from index a to b? The naive approach loops through a to b for each query. With n, q up to , that's too slow. You just learned prefix sums.
This problem is the direct application. Can you see how to answer each query in ? Read the problem statement carefully, noting the constraints. Try to identify the recursive structure before looking at the solution.