独木舟
You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.
Description
旅行社计划组织一个独木舟旅行。租用的独木舟都是一样的,最多乘两人,而且载重有一个限度。现在要节约费用,所以要尽可能地租用最少的舟。本题的任务是读入独木舟的载重量,参加旅行的人数以及每个人的体重,计算出所需要的独木舟数目。
Input Format
第1行是w(80≤w≤200),表示每条独木舟最大的载重量。
第2行是正整数n(1≤n≤30000),表示参加旅行的人数。
接下来的n行,每行是一个正整数ti(5≤ti≤w),表示每个人的重量。
Output Format
输出一行一个数,表示最少的独木舟数目。
100
9
90
20
20
30
50
60
70
80
90
6
2025_07_03吉利学院暑假实训周-上机实践-4
- Status
- Done
- Rule
- XCPC
- Problem
- 8
- Start at
- 2025-7-4 14:00
- End at
- 2025-7-4 17:00
- Duration
- 3 hour(s)
- Host
- Partic.
- 27