Woburn Challenge 2015-16 Round 2 - Senior Division
"The Force is strong in my family…"
"My father has it."
"I have it."
"My sister has it."
"There's one other person with that power…"

With the Death Star reduced to stardust, the evil Galactic Empire has
been forced to pull out all stops in their fight against the rebels.
John Cena has devised a plan to deal massive amounts of damage to the
Imperial squadron. Upon studying stolen flight plans, he's realized that
all of the enemy ships will always stay within a single plane of space.
Then, treating it as a 2D Cartesian plane, he's set up a "blast zone" –
a rectangle with its bottom-left corner at coordinates
As mentioned, John Cena has access to the Imperial flight plans, which
happen to be quite simple. The
Now, John Cena's battle plan will consist of
: First, wait seconds after the previous step, and then set off a charge to deal damage to each ship which is currently within the blast zone (inclusively) : To assess success, determine the total amount of damage dealt so far to ships
John Cena's time is now, but can you help him determine the results of
each of his steps of type
Note: In cases worth
Input Specification
The first line of input consists of two space-separated integers
The second line consists of four space-separated integers
The next
The next
Output Specification
For each step in the input where
Sample Input
3 14
-2 -1 3 3
7 2 -2 0
-1 -6 1 2
-1 0 0 3
1 0 5
1 1 7
2 1 2
2 1 3
1 1 1
1 0 1
2 1 3
1 1 30
1 2 6
1 1 1000
2 1 1
2 2 2
2 3 3
2 2 3
Sample Output
0
12
14
32
30
12
42
Explanation
The first charge is set off immediately, and the second occurs
Comments