$ T1: a collection of $ merger
Into a chain-off ring, the section DP $ $
$T2:climb$
Obviously if it is determined that the final in front of each drug must try to choose $ AB $ largest drug
Considered in the $ AB $ sort enumerate each time as the answer
So there are two cases
1, with the drug have not eaten out of
2, with the previously eaten out of medicine
For the second case, provided the drug is taken $ m $, considering the influence remove a drug before eating
Obviously make $ m $ shifted left behind medicine
Then we need to determine each point behind $ m $ $ H_ {j} - (A_ {i} -B_ {i}) $ and $ \ sum \ limits_ {t = 1} ^ {j} $ magnitude relationship
Then maintains a data structure with just $ H_ {j} - minimum \ sum \ limits_ {t = 1} ^ {j} $ on the line
$T3:coin$
$ SG $ function, is still under study