[Huawei OD test questions] Express delivery truck (java) 100% pass rate [2023 (B volume) 100 points]

express van

topic description

A truck delivering courier
deliveries is placed in cuboid courier boxes of different sizes.
In order to be able to load more couriers without overloading the truck,
it is necessary to calculate how many couriers can be loaded at most.
Note: The volume of express delivery is not limited.
The maximum number of couriers is 1,000, and the maximum load of trucks is 50,000.

enter description

Enter the weight of each courier in the first line
, separated by commas,
such as 5, 10, 2, 11,
and enter the load capacity of the truck in the second line,
such as 20

output description

Output the maximum number of couriers that can be loaded,
such as 3

example one

enter

5,10,2,11
20

output

3

Reference Problem Solving Java

import java.util.<

Guess you like

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