posted on 2023-05-03 20:21 read(613) comment(0) like(8) collect(4)
Xiao Ming has n planks, and the length of the i ( 1 ≤ i ≤ n ) plank is ai.
Xiao Ming bought a piece of wood with a length of m. This piece of wood can be cut into any pieces and spliced to the existing plank to lengthen the plank.
Xiao Ming wants the shortest template to be as long as possible. May I ask how long the shortest board can be after Xiao Ming lengthens the board?
The first line of input contains two positive integers, n ( 1 ≤ n ≤ 10^3 ), m ( 1 ≤ m ≤ 10^6 ), n represents the number of boards, and m represents the length of the board.
The second line of input contains n positive integers, a1, a2,…an ( 1 ≤ ai ≤ 10^6 ).
The only line of output contains a positive integer, indicating the maximum length of the shortest plank after lengthening the plank?
enter | 5 3 4 5 3 5 5 |
output | 5 |
illustrate | Increase the length of the first plank by 1, and increase the length of the third plank by 2. The length of these five planks becomes [5,5,5,5,5], the shortest plank |
Author:kkkkkkkkkkdsdsd
link:http://www.pythonblackhole.com/blog/article/269/4d1c2dcf79ed135aebe2/
source:python black hole net
Please indicate the source for any form of reprinting. If any infringement is discovered, it will be held legally responsible.
name:
Comment content: (supports up to 255 characters)
Copyright © 2018-2021 python black hole network All Rights Reserved All rights reserved, and all rights reserved.京ICP备18063182号-7
For complaints and reports, and advertising cooperation, please contact vgs_info@163.com or QQ3083709327
Disclaimer: All articles on the website are uploaded by users and are only for readers' learning and communication use, and commercial use is prohibited. If the article involves pornography, reactionary, infringement and other illegal information, please report it to us and we will delete it immediately after verification!