#Q188. 「一本通 5.6 例 3」任务安排 3

    ID: 2270 Type: Default 1000ms 512MiB Tried: 0 Accepted: 0 Difficulty: (None) Uploaded By: Tags>DPSDOI二分斜率优化单调队列2012一本通提高

「一本通 5.6 例 3」任务安排 3

Description

Original source: SDOI 2012

The input format and data range have been modified, while the rest remains the same as LOJ #10184. Task Arrangement 1.

Input Format

The first line contains two integers, NN and SS;
The next NN lines each contain two integers TiT_i and CiC_i.

Data Range and Hints

For all data, $1\le N\le 3\times 10^5,1\le S\le 2^8,|T_i|\le 2^8,0\le C_i\le 2^8$.

Note that although TiT_i represents time, in this problem TiT_i may be negative.