Junseok became the president of ChAOS (Chung-ang Algorithm Organization and Study), the work piled up, and he never got around to studying during the exam period. Now it is the night before the exam. The professor did post two hints beforehand.
- No question mixes several chapters.
- Each chapter gets exactly one question. That question can only be solved by someone who knows everything in the chapter.
The professor also wrote down the score of each chapter next to the hints. Assume Junseok gets a chapter's question right if he studies that chapter for its estimated study time or longer. A chapter is either studied or not studied, and there is no partial credit.
Find the highest total score Junseok can reach with the time he has left.