Woburn Challenge 2015-16 Round 1 - Senior Division

Welcome to the first Woburn Challenge in over a decade! We hope you find these contests fun and challenging.
Let's start by getting to know Woburn a little more. The motto of Woburn Collegiate Institute is Studium Eruditionis Crescat, or Let the Zeal for Learning Flourish. Clearly, Woburn values academic excellency, so it's no surprise that students often receive a hefty workload. There are also many extracurricular opportunities available to students, including Woburn Music, drama, and of course, the Programming Enrichment Group. Members of PEG meet Wednesdays and Fridays after school to study advanced computer science concepts, and are often assigned a fair amount of programming homework. Not only has PEG made students superb at programming, they've made students love programming. In fact, PEG students are often so hooked onto their programming homework that they forget about actual homework and become swamped with upcoming deadlines!
Being the natural problem-solvers they are, PEG students have realized
that programming is once again the solution. They've decided to write a
program to help them handle the workload of Woburn's courses, and
they've asked you for help! Specifically, there are
Furthermore, each assignment
Input Specification
The first line of input will contain a single integer
Output Specification
Output a single integer representing the minimum total penalty marks that can be incurred across all of the assignments, if your program schedules the assignments optimally.
Sample Input
4
40 40
80 60
120 30
130 80
Sample Output
80
Explanation
There are four assignments, respectively due
- Immediate start working on assignment
. You'll be done just in the nick of time and incur no penalty marks. - Right after you hand in assignment
(at minutes in), start working on assignment . Unfortunately, you'll only have minutes to work on the assignment, and so you'll have to incur penalty marks. - Right after you hand in assignment
(at minutes in), start working on assignment . You'll be able to get minutes of work on it before the due date (at minutes in). You'll have to incur penalty marks. - Unfortunately, there was no time at all to tackle assignment
, so you'll have to accept a zero and incur the full penalty marks.
In total, there are
Comments