## DMOPC '16 Contest 4 P2 - Systests

View as PDF

Points: 7 (partial)
Time limit: 1.0s
Memory limit: 256M

Author:
Problem type

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…

#### Input Specification

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.

#### Output Specification

A single integer, the number of points the program can get.

For all cases, .

1 5 DNE
2 5
3 30
4 60

#### Sample Input

3
1 5 100
20 21 10
1 18 1
2
2
5

#### Sample Output

10

#### 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.