I. Interval Cover
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output
Example
Input
5 10
0 3
3 4
4 10
0 7
7 10
7
3
1 1 6
3
1 0 1
3
2 4 10
3
Output
0
2
1
2