[Huawei OD test questions] rent a car and ride the greenway (C language) 100% pass rate super detailed code comment code depth 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@

Rent a car and ride the greenway

The department organizes green island cycling team building activities. Rent public tandem bicycles, each bicycle can seat up to two people, and do the maximum load M. Given the weight of each person in the department, what is the maximum number of tandem bicycles that can be rented.

Enter a description:

The two numbers m and n in the first line respectively represent the weight limit of bicycles and the total number of people in the department.
In the second line, n numbers represent the weight of each person, and the weight is less than or equal to the bicycle weight limit m.

Guess you like

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