AT_awc0002_c 植物の成長観察
Description
Takahashi is conducting an experiment growing $ N $ types of plants in his school science class.
Each plant has a different initial height and daily growth rate. Specifically, the $ i $ -th plant ( $ 1 \leq i \leq N $ ) has a height of $ A_i $ cm at the start of the experiment (day $ 0 $ ) and grows by $ B_i $ cm per day. That is, the height of the $ i $ -th plant on day $ d $ ( $ d = 0, 1, 2, \ldots $ ) is $ A_i + B_i \times d $ cm.
Takahashi plans to check the heights of the plants every day on day $ 0 $ , day $ 1 $ , day $ 2 $ , $ \ldots $ , and end the observation on the first day when all plants have a height of at least $ M $ cm.
Find the day when the observation ends, that is, the smallest non-negative integer $ d $ such that $ A_i + B_i \times d \geq M $ holds for all $ i $ ( $ 1 \leq i \leq N $ ).
Note that under the given constraints, the answer is guaranteed to exist as a finite value.
Input Format
> $ N $ $ M $ $ A_1 $ $ B_1 $ $ A_2 $ $ B_2 $ $ \vdots $ $ A_N $ $ B_N $
- The first line contains an integer $ N $ representing the number of plant types and an integer $ M $ representing the target height, separated by a space.
- The following $ N $ lines each contain, for the $ i $ -th line ( $ 1 \leq i \leq N $ ), the initial height $ A_i $ and the daily growth rate $ B_i $ of the $ i $ -th plant, separated by a space.
Output Format
Print on a single line the smallest non-negative integer $ d $ such that all plants have a height of at least $ M $ cm.
Explanation/Hint
### Constraints
- $ 1 \leq N \leq 2 \times 10^5 $
- $ 1 \leq M \leq 10^9 $
- $ 1 \leq A_i \leq 10^9 $
- $ 1 \leq B_i \leq 10^9 $
- All input values are integers