• [1147] Bad O2Jam

  • 时间限制: 3000 ms 内存限制: 131070 K
  • 问题描述
  • O2Jam is a music game. But it's Chinese version died long long ago.
    XadillaX likes to play it very much. The problem is that he plays very bad.
    What's his worst skill is to keep the long note. Long note is: you must hold it at its beginning and release it at its end.
    At the same time, it may appear several note but XadillaX only may hold some of them, not all.

    Now give you several long notes' start time and end time and how many notes XadillaX can hold at one time. I will querying for several times, you should tell me how many notes he will miss at a certain moment.

    You may consider this O2Jam is not a normal O2Jam, it may appear beyond 7 notes at one moment.


  • 输入
  • This problem has several cases.
    The first line of each case is three integers N (0 < N <= 300000), Q (0 < Q <= 300000, indicates the times of querying) and K (0 < K <= 10, indicates the number of XadillaX can hold at a moment).
    Then follow N lines. Each line indicates one note, containing two integers Bi and Ei. (0 <= Bi <= Ei <= 10000000, indicate the start time and end time of each note).
    Next Q lines is Q queryings. Each querying is a integer Qi(0 < Qi <= max(Ei)).
  • 输出
  • For each querying, you should output how many note(s) XadillaX will miss at that moment. Then for each case, you should output how long will XadillaX miss at least one note?
  • 样例输入
  • 3 2 1
    0 5
    6 7
    1 3
    2
    5
    
  • 样例输出
  • 1
    0
    3
    
  • 提示
  • 来源
  • XadillaX
  • 操作

显示春菜