CNZ lives in the forest, and he has

energy stones, numbered from

to

.
CNZ need to eat energy generated by energy stones.
The

energy stone initially contains

units of energy and will increase

units of energy each second.
The maximum energy of

energy stone is

, the stone's energy stops increasing once it reach

.
Each time he absorbs the energy of a continuous interval of stone. For example, if CNZ absorbs the energy of [S, T] stones, all energy stones numbered from

to

will become zero units of energy. CNZ can get the sum of energy in this range.
CNZ will eat

times. The i-th eating happens after

seconds, and eat interval is

.
What's the total amount of energy CNZ has eaten after

eating.