Huawei OD Computer Test Real Questions-Conference Reception-2023 OD Unified Examination (Paper B)

Topic description:

An organization holds a meeting, and multiple delegations arrive at the same time. There is only one car at the reception desk, which can receive multiple delegations at the same time. In order to improve vehicle utilization, please help the receptionist calculate a reception plan that can fill the car, and output the plan quantity.

constraint:

1. A group can only board one car, and the number of delegations (the number of delegations is less than 30, the number of each delegation is less than 30) is less than the car capacity (the car capacity is less than 100)

2. The vehicle needs to be filled

Enter description:

The number of delegations in the first line, separated by English commas, the number of delegations is less than 30, and the number of each delegation is less than 30

The passenger capacity of the second row of cars is less than 100

Output description:

Number of plans to fill the car

If there is no solution, output 0

Additional information: Number of delegations: 5, 4, 2, 3, 2, 4, 9

Car passenger capacity 10

Output 4
explains that the following ways can fill the car, so the priority reception output is 4
     [2, 3, 5]
     [2, 4, 4]
     [2, 3, 5]
     [2, 4, 4]

 close

Example 1

enter:

5,4,2,3,2,4,9
10

Output:

4

illustrate:

Explain that the following methods can fill the car, so the priority reception output is 4
 [2, 3, 5]
 [2, 4, 4] [2, 3, 5]
 [
 2, 4, 4]

Problem-solving ideas: This question test

Guess you like

Origin blog.csdn.net/2301_76848549/article/details/133219305