#P1687. 机器人小Q
机器人小Q
Description
After successfully delivering a big order, the restaurant decided to bring in a new member: Robot Xiao Q. Xiao Q’s arrival brought in many more customers, but after a while a new problem appeared. Unlike us, Xiao Q needs energy input to keep going. The energy menu already lists units of energy in a fixed order, but because their sources differ, ingesting each unit takes a certain amount of time. Xiao Q’s maximum charging time per day is ; if this limit is exceeded, he will crash automatically. Everyone wants Xiao Q to stay, so after some research, HWX and XYF went to negotiate with the boss. From LXC’s point of view, he does not want to hear any sob story; he only wants to know: to let Xiao Q obtain units of energy (that is, you may skip some units on the menu), what is the minimum number of days needed for charging?
Input Format
The first line contains two integers , meaning there are energy units on Xiao Q’s menu, and we want to obtain of them.
The second line contains integers, where the ‑th integer is the charging time required for the ‑th energy unit.
Output Format
Output a single line containing one integer: the minimum number of days required.
If it is impossible to meet the requirement, output You can't do it..
7 3
1 119 119 1 120 120 118
2
Hint
Sample Explanation
Accept only . Obviously, this takes days.
Constraints
For of the testdata, .
For of the testdata, .
Translated by ChatGPT 5
京公网安备 11011102002149号