Bessie是一头饥饿的牛。每天晚餐时,如果谷仓里有干草包,她会吃一个干草包。农夫约翰不想让Bessie挨饿,所以他会寄来干草包的天,这些干草包在早上到达(晚餐之前)。即在di天,农夫约翰发送了bi干草包 (1≤di≤1e14,1≤bi≤1e9).
请计算Bessie在T天吃的干草包总数。
Bessie is a hungry cow. Each day, for dinner, if there is a haybale in the barn, she will eat one haybale. Farmer John does not want Bessie to starve, so some days he sends a delivery of haybales, which arrive in the morning (before dinner). In particular, on day di, Farmer John sends a delivery of bi haybales (1≤di≤1014, 1≤bi≤109).
Compute the total number of haybales Bessie will eat during the first T days.