Having finished her homework, Molly decides to write the DMOPC. However, as a kitten, she can't actually code, and decides to asks you to compete on her behalf. As you (probably) know, the DMOPC is systested, usually with batches. Failing any test case in a batch results in a score of 0 for that batch.
Being the great
hacker programmer that you are, you know precisely which cases belong to which batch, and how your program will do on the cases. All that remains is to see how many points you can get…
Line : An integer, , the number of batched cases that follow.
Line : 3 space separated integers, , , and , indicating that the batch starts on test case , ends on case , and is worth points.
Line : An integer, , the number of test cases the program fails.
Lines : An integer, , indicating the program fails the test case.
A single integer, the number of points the program can get.
For all cases, .
3 1 5 100 20 21 10 1 18 1 2 2 5
Explanation for Sample Output
By failing test cases 2 and 5, the program fails batches 1 and 3, and only passes batch 2, giving it a total of points.