Codeforces Round 222 (Div. 1)
E
Cookie Clicker
Codeforces
2800
原题
← D→
翻译中…

Kostya is playing the computer game Cookie Clicker. The goal of this game is to gather cookies. You can get cookies using different buildings: you can just click a special field on the screen and get the cookies for the clicks, you can buy a cookie factory, an alchemy lab, a time machine and it all will bring lots and lots of cookies.

翻译中…

At the beginning of the game (time 0), Kostya has 0 cookies and no buildings. He has $*n*$ available buildings to choose from: the $*i*$-th building is worth $*c*_{*i*}$ cookies and when it's built it brings $*v*_{*i*}$ cookies at the end of each second. Also, to make the game more interesting to play, Kostya decided to add a limit: at each moment of time, he can use only one building. Of course, he can change the active building each second at his discretion.

翻译中…

It's important that Kostya is playing a version of the game where he can buy new buildings and change active building only at time moments that are multiples of one second. Kostya can buy new building and use it at the same time. If Kostya starts to use a building at the time moment $*t*$, he can get the first profit from it only at the time moment $*t* + 1$.

翻译中…

Kostya wants to earn at least $*s*$ cookies as quickly as possible. Determine the number of seconds he needs to do that.

翻译中…

Input

翻译中…

The first line contains two integers $*n*$ and $*s*$ ($1 ≤ *n* ≤ 2·10^{5}$, $1 ≤ *s* ≤ 10^{16}$) — the number of buildings in the game and the number of cookies Kostya wants to earn.

翻译中…

Each of the next $*n*$ lines contains two integers $*v*_{*i*}$ and $*c*_{*i*}$ ($1 ≤ *v*_{*i*} ≤ 10^{8}$, $0 ≤ *c*_{*i*} ≤ 10^{8}$) — the number of cookies the $*i*$-th building brings per second and the building's price.

翻译中…

Output

翻译中…

Output the only integer — the minimum number of seconds Kostya needs to earn at least $*s*$ cookies. It is guaranteed that he can do it.

翻译中…

样例

Input #1
3 9
1 0
2 3
5 4
Output #1
6
InputCopy OutputCopy
Input #2
3 6
1 0
2 2
5 4
Output #2
5
InputCopy OutputCopy
Input #3
3 13
1 0
2 2
6 5
Output #3
7
InputCopy OutputCopy
Input #4
1 10000000000000000
1 0
Output #4
10000000000000000
InputCopy OutputCopy
题目信息
题号
377E
时间限制
2 s
内存限制
256 MB
标签
动态规划
计算几何

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。