[Huawei OD machine test real questions] the shortest plank length (python) 100% pass rate super detailed code comment code interpretation

[Huawei OD machine test real questions 2022&2023] real test catalog @click here @
[Huawei OD machine test real questions] signal transmission and reception & trial reading & @click here @
[Huawei OD machine real test questions] rent a car to ride the greenway & trial reading & @点here@

Minimum plank length

Time limit: 1s Space limit: 256MB Limited language: unlimited

Title description:

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?

Enter a description:

The first line of input contains two

Guess you like

Origin blog.csdn.net/weixin_45541762/article/details/130611707