欢迎来到起遇信息学
起遇信息学正处于上线筹建阶段,以下功能已全部开放免费体验: ✅ 完整题库浏览与代码提交评测(C / C++ / Python / Java 等) ✅ 入门到进阶的系列课程试读、作业与考试 ✅ AI 提示、AI 作业分析等智能助教功能 ✅ 赛事模拟与个人能力报告 ✅ 邮箱注册开放 ⏳ 付费课程订阅与微信/支付宝支付通道 ⏳ 手机号登录,微信扫码登录、微信公众号绑定 使用中如遇任何问题,欢迎通过页面底部 **"联系我们"** 与我们沟通。
CF1042A.Benches
Benches
There are benches in the Berland Central park. It is known that people are currently sitting on the -th bench. Another people are coming to the park and each of them is going to have a seat on some bench out of available.
Let be the maximum number of people sitting on one bench after additional people came to the park. Calculate the minimum possible and the maximum possible .
Nobody leaves the taken seat during the whole process.
Input
The first line contains a single integer — the number of benches in the park.
The second line contains a single integer — the number of people additionally coming to the park.
Each of the next lines contains a single integer — the initial number of people on the -th bench.
Output
Print the minimum possible and the maximum possible , where is the maximum number of people sitting on one bench after additional people came to the park.
Note
In the first example, each of four benches is occupied by a single person. The minimum is . For example, it is possible to achieve if two newcomers occupy the first bench, one occupies the second bench, one occupies the third bench, and two remaining — the fourth bench. The maximum is . That requires all six new people to occupy the same bench.
The second example has its minimum equal to and maximum equal to , as there is just a single bench in the park and all people will occupy it.
Samples
4
6
1
1
1
1
3 7
1
10
5
15 15
3
6
1
6
5
6 12
3
7
1
6
5
7 13
在线编程 IDE
建议全屏模式获得最佳体验
| 进入全屏编程 | Alt+E |
| 递交评测 | Ctrl+Enter |
| 注释/取消注释 | Ctrl+/ |
| 缩放字体 | Ctrl+滚轮 |