欢迎来到起遇信息学
起遇信息学正处于上线筹建阶段,以下功能已全部开放免费体验: ✅ 完整题库浏览与代码提交评测(C / C++ / Python / Java 等) ✅ 入门到进阶的系列课程试读、作业与考试 ✅ AI 提示、AI 作业分析等智能助教功能 ✅ 赛事模拟与个人能力报告 ✅ 邮箱注册开放 ⏳ 付费课程订阅与微信/支付宝支付通道 ⏳ 手机号登录,微信扫码登录、微信公众号绑定 使用中如遇任何问题,欢迎通过页面底部 **"联系我们"** 与我们沟通。
CF967B.Watering System
Watering System
Arkady wants to water his only flower. Unfortunately, he has a very poor watering system that was designed for flowers and so it looks like a pipe with holes. Arkady can only use the water that flows from the first hole.
Arkady can block some of the holes, and then pour liters of water into the pipe. After that, the water will flow out from the non-blocked holes proportionally to their sizes . In other words, if the sum of sizes of non-blocked holes is , and the -th hole is not blocked, liters of water will flow out of it.
What is the minimum number of holes Arkady should block to make at least liters of water flow out of the first hole?
Input
The first line contains three integers , , (, ) — the number of holes, the volume of water Arkady will pour into the system, and the volume he wants to get out of the first hole.
The second line contains integers () — the sizes of the holes.
Output
Print a single integer — the number of holes Arkady should block.
Note
In the first example Arkady should block at least one hole. After that, liters of water will flow out of the first hole, and that suits Arkady.
In the second example even without blocking any hole, liters will flow out of the first hole, that is not less than .
In the third example Arkady has to block all holes except the first to make all water flow out of the first hole.
Samples
4 10 3
2 2 2 2
1
4 80 20
3 2 1 4
0
5 10 10
1000 1 1 1 1
4
在线编程 IDE
建议全屏模式获得最佳体验
| 进入全屏编程 | Alt+E |
| 递交评测 | Ctrl+Enter |
| 注释/取消注释 | Ctrl+/ |
| 缩放字体 | Ctrl+滚轮 |