生日聚会
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.
Background
小 过生日啦!
Description
小 邀请了 个人,除了小 没有讨厌的人之外,其他人都有一个讨厌的人。
而第 个人来就可以获得 的欢快值。
但由于场地有限,所以最多只能容纳 个人,小 想知道欢快值最大是多少?
Format
Input
第一行一个整数 。
接下来 个整数, 表示 讨厌的人。
接下来 个整数,表示 代表每个人的欢快值。
注意,小 也可能不去(
Output
一行一个整数,表示答案。
Samples
5 2
1 2 3 1
1 8 10 8 2
16
Limitation
对于所有数据,保证 。
非常好看
- Status
- Done
- Rule
- Ledo
- Problem
- 40
- Start at
- 2025-1-24 16:45
- End at
- 2025-4-18 0:45
- Duration
- 2000 hour(s)
- Host
- Partic.
- 17