欢迎来到起遇信息学
起遇信息学正处于上线筹建阶段,以下功能已全部开放免费体验: ✅ 完整题库浏览与代码提交评测(C / C++ / Python / Java 等) ✅ 入门到进阶的系列课程试读、作业与考试 ✅ AI 提示、AI 作业分析等智能助教功能 ✅ 赛事模拟与个人能力报告 ✅ 邮箱注册开放 ⏳ 付费课程订阅与微信/支付宝支付通道 ⏳ 手机号登录,微信扫码登录、微信公众号绑定 使用中如遇任何问题,欢迎通过页面底部 **"联系我们"** 与我们沟通。
CF1036A.Function Height
Function Height
You are given a set of integer points on a Cartesian plane. Points are numbered from to inclusive. Let be the -th point. The -coordinate of the point equals . The -coordinate of the point equals zero (initially). Thus, initially .
The given points are vertices of a plot of a piecewise function. The -th piece of the function is the segment .
In one move you can increase the -coordinate of any point with odd -coordinate (i.e. such points are ) by . Note that the corresponding segments also change.
For example, the following plot shows a function for (i.e. number of points is ) in which we increased the -coordinate of the point three times and -coordinate of the point one time:

Let the area of the plot be the area below this plot and above the coordinate axis OX. For example, the area of the plot on the picture above is 4 (the light blue area on the picture above is the area of the plot drawn on it).
Let the height of the plot be the maximum -coordinate among all initial points in the plot (i.e. points ). The height of the plot on the picture above is 3.
Your problem is to say which minimum possible height can have the plot consisting of vertices and having an area equal to . Note that it is unnecessary to minimize the number of moves.
It is easy to see that any answer which can be obtained by performing moves described above always exists and is an integer number not exceeding .
Input
The first line of the input contains two integers and () — the number of vertices in a plot of a piecewise function and the area we need to obtain.
Output
Print one integer — the minimum possible height of a plot consisting of vertices and with an area equals . It is easy to see that any answer which can be obtained by performing moves described above always exists and is an integer number not exceeding .
Note
One of the possible answers to the first example:

The area of this plot is 3, the height of this plot is 1.
There is only one possible answer to the second example:

The area of this plot is 12, the height of this plot is 3.
Samples
4 3
1
4 12
3
999999999999999999 999999999999999986
1
在线编程 IDE
建议全屏模式获得最佳体验
| 进入全屏编程 | Alt+E |
| 递交评测 | Ctrl+Enter |
| 注释/取消注释 | Ctrl+/ |
| 缩放字体 | Ctrl+滚轮 |