An N×N table is filled with N×N numbers. Write a program that computes the sum of the entries from (x1,y1) to (x2,y2). Here (x,y) means row x, column y.
For example, take N=4 and the table below.
The sum from (2,2) to (3,4) is 3+4+5+4+5+6=27, and the sum from (4,4) to (4,4) is 7.
Given the numbers in the table and the sum queries, write a program that answers them.