Company: Agoda_16nov
Difficulty: medium
Maximum Knowledge Problem Description You are planning a conference that lasts for d days. You have a schedule of n meetings with their availability periods and knowledge gain values. Each meeting is available from day s_i to day e_i (inclusive) and provides a knowledge gain of a_i. You can attend at most k meetings per day. Determine the maximum knowledge that can be gained in a single day. Examples Example 1: Input: d = 10, n = 4, k = 2, s = [2, 5, 4, 3], e = [8, 9, 7, 5], a = [800, 1600, 200, 400] Output: 2400 Explanation: - Day 1: No meetings are available, so knowledge gain is 0. - Day 2: Only Meeting 1 is available, so knowledge gain is 800. - Day 3: Meetings 1 and 4 are available, for a total gain of 800 + 400 = 1200. - Day 4: Meetings 1, 3 and 4 are available, for a total gain of 800 + 200 + 400 = 1400. - Day 5: Meetings 1, 2, 3 and 4 are available, for a total gain of 800 + 1600 + 200 + 400 = 3000. However, we can only attend k=2 meetings. So we pick the meetings with highest