#63595. [USACO 2023 Feb Bronze]Hungry Cow
[USACO 2023 Feb Bronze]Hungry Cow
暂无测试数据。
英文题面
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 $d_i$, Farmer John sends a delivery of $b_i$ haybales ($1\leq d_i \leq 10^{14}$, $1 \leq b_i \leq 10^9$).
Compute the total number of haybales Bessie will eat during the first $T$ days.
译文
贝茜是一头饥饿牛。对于每天的晚餐,如果谷仓里有一捆干草,她就会吃一捆。农民约翰不想让贝茜挨饿,所以有时他送很多捆干草,早上(晚饭前)送到。特别地,在第 $d_i$ 天,农夫约翰送了 $b_i$ 捆干草($1\leq d_i \leq 10^{14}$, $1\leq b_i \leq 10^9$)。
计算贝茜在前 $T$ 天会吃掉的干草总数。
输入格式
The first line contains $N$ and $T$ ($1 \le N \le 10^5$, $1 \le T \le 10^{14}$).
The next $N$ lines each contain $d_i$ and $b_i$. It is additionally guaranteed that $1\le d_1 < d_2 < \dots < d_N\le T$.
第一行包含 $N$ 和 $T$ ($1 \le N \le 10^5$, $1 \le T \le 10^{14}$)。
接下来的 $N$ 行每个包含 $d_i$ 和 $b_i$。另外还保证 $1\le d_1 < d_2 < \dots < d_N\le T$。
输出格式
Output the number of haybales that Bessie will eat during the first $T$ days.
输出贝茜在前 $T$ 天会吃的干草数量。
数据范围
- Inputs 4-7: $T\leq 10^5$
- Inputs 8-13: No additional constraints.
1 5
1 2
2
2 5
1 2
5 10
3
2 5
1 10
5 10
5