1735:滑雪训练

文件提交:无需freopen 内存限制:128 MB 时间限制:1.000 S
评测方式:普通裁判 命题人:
提交:3 解决:2

题目描述

小爱最近迷上了滑雪,某滑雪场有 lns="http://www.w3.org/1998/Math/MathML"> 条不同难度的雪道,只有学习并滑了第 lns="http://www.w3.org/1998/Math/MathML"> 条雪道,才能去参加第 lns="http://www.w3.org/1998/Math/MathML">+1 条雪道的学习与训练。

已知,第一次滑第 lns="http://www.w3.org/1998/Math/MathML"> 条雪道时,需要先进行 lns="http://www.w3.org/1998/Math/MathML"> 分钟的学习,再花 lns="http://www.w3.org/1998/Math/MathML">分钟滑该雪道一次,才算学习完成。若之后再滑第 lns="http://www.w3.org/1998/Math/MathML"> 条雪道,则仅需 lns="http://www.w3.org/1998/Math/MathML"> 分钟即可滑一次。

小爱共有 lns="http://www.w3.org/1998/Math/MathML"> 分钟时间,请问如何安排才能使他能滑的圈数最多?

输入

输入第一行,两个正整数 lns="http://www.w3.org/1998/Math/MathML">,
接下来 lns="http://www.w3.org/1998/Math/MathML"> 行:每行两个正整数lns="http://www.w3.org/1998/Math/MathML">,表示第lns="http://www.w3.org/1998/Math/MathML">条雪道需要的学习时间和滑雪时间。


  • 对于lns="http://www.w3.org/1998/Math/MathML">30%的数据,lns="http://www.w3.org/1998/Math/MathML">110
  • 对于lns="http://www.w3.org/1998/Math/MathML">60%的数据,lns="http://www.w3.org/1998/Math/MathML">1103
  • 对于lns="http://www.w3.org/1998/Math/MathML">100%的数据,lns="http://www.w3.org/1998/Math/MathML">1105lns="http://www.w3.org/1998/Math/MathML">1,,1018


输出

输出一个正整数,表示小爱最多可以滑的圈数。

样例输入-1 复制

3 100
10 20
5 5
20 10

样例输出-1 复制

14