"But baby, I've been, I've been praying hard,
Said, no more counting dollars
We'll be counting stars"
Grandpa Shaw loves counting stars.
One evening he was sitting in his armchar, trying to figure out this problem.
Consider the sky as a rectangular coordinates, each star has a coordinate (Xi,Yi).
To make it simple, all the stars are in the first quadrant.
Now he want to know how many stars there are in the square formed by (0,0) and (x,y).
(including stars in edges, 4 vertices of the square is (0,0) (x,0) (x,y) (0,y))
There are n stars in the sky, and he raised m questions.
Because grandpa Shaw's eyesight is poor, he ask you for help.
in this image, yellow stars are in the square, blue ones are not.