There is a lawn in front of Martynas's house. The lawn can be viewed as a line of N centimeters, with one tuft of grass growing at every centimeter. The tuft at position i (1≤i≤N) has height ai centimeters.
The grass has never been cut, so it is hard to even take a walk across the lawn, let alone have a picnic.
Martynas bought a lawnmower and plans to cut most of the grass over M days. Day j (1≤j≤M) proceeds as follows, in order:
For example, suppose the lawn is 4cm long (N=4) and the tuft heights are 1,2,1,3. Martynas works for M=2 days, driving across the lawn b1=2 times on the first day and b2=1 time on the second day.
On the morning of day 1 every tuft grows by 1cm, giving 2,3,2,4. During the day he mows twice, so each tuft loses 2cm, leaving 0,1,0,2; in the evening 0+1+0+2=3cm of grass remains.
On the morning of day 2 only the tufts that still have grass grow (the first and third stay at 0), giving 0,2,0,3. He mows once, leaving 0,1,0,2; in the evening 0+1+0+2=3cm remains again.
Given the initial state of the lawn and the mowing plan for M days, compute the total height of grass left uncut in the evening of each of the M days.
Print M lines. Line k (1≤k≤M) must contain a single integer — the total height of grass (in centimeters) left uncut at the end of day k.
Note that the computation may require a 64-bit integer type (long long in C/C++).