DWITE Online Computer Programming Contest

Kill Dash Nine

February 2009
Problem 2
So I mean what do you do when, like when there’s a process running,
and you know it just doesn’t know when to quit?

I donno; I guess you’ve got to kill it.

Yeah.. yeah.. But what if it’s like locked up,
and it’s not responding to messages..

Kill dash one?

No.. No, man. What if you just want to raise the interrupt priority
all the way to the top? Then you’ve got to run..

Kill dash nine!
“Monzy performs at Stanford Univ.

The input file DATA2.txt will contain 5 sets of inputs, 6 lines each. The first line will be a command in a form of kill -signal_number, with 1 ≤ signal_number ≤ 9. Each of the following lines will contain a process name (a single word) and an integer 1 ≤ i ≤ 9 – how badly it’s broken.

The output file OUT2.txt will contain 5 sets of output, up to 25 lines max, the list of processes remaining after the command.

Note: That is, any process with a number smaller than or equal to the one used in the kill command will be taken out of the list. Output what remains.

Another note: Keep the list of processes in the same order as they were in the input file.

Sample Input (first two shown):
kill -1
one 1
two 2
three 3
four 4
five 5
kill -4
tony 1
dan 2
monzy 3
compsci 4
dwite 5
Sample Output (first two shown):