Codeforces Round 524 (Div. 2)
F
Katya and Segments Sets
Codeforces
2400
原题
← E→
翻译中…

It is a very important day for Katya. She has a test in a programming class. As always, she was given an interesting problem that she solved very fast. Can you solve that problem?

翻译中…

You are given $n$ ordered segments sets. Each segment can be represented as a pair of two integers $[l, r]$ where $l\leq r$. Each set can contain an arbitrary number of segments (even $0$). It is possible that some segments are equal.

翻译中…

You are also given $m$ queries, each of them can be represented as four numbers: $a, b, x, y$. For each segment, find out whether it is true that each set $p$ ($a\leq p\leq b$) contains at least one segment $[l, r]$ that lies entirely on the segment $[x, y]$, that is $x\leq l\leq r\leq y$.

翻译中…

Find out the answer to each query.

翻译中…

Note that you need to solve this problem online. That is, you will get a new query only after you print the answer for the previous query.

翻译中…

Input

翻译中…

The first line contains three integers $n$, $m$, and $k$ $(1\leq n,m\leq 10^5, 1\leq k\leq 3\cdot10^5)$ — the number of sets, queries, and segments respectively.

翻译中…

Each of the next $k$ lines contains three integers $l$, $r$, and $p$ $(1\leq l\leq r\leq 10^9, 1\leq p\leq n)$ — the limits of the segment and the index of a set, to which this segment belongs.

翻译中…

Each of the next $m$ lines contains four integers $a, b, x, y$ $(1\leq a\leq b\leq n, 1\leq x\leq y\leq 10^9)$ — the description of the query.

翻译中…

Output

翻译中…

For each query, print "yes" or "no" in a new line.

翻译中…

Interaction

翻译中…

After printing a query, do not forget to output end of line and flush the output. Otherwise, you will get Idleness limit exceeded. To do this, use:

翻译中…
  • fflush(stdout) or cout.flush() in C++;
  • System.out.flush() in Java;
  • flush(output) in Pascal;
  • stdout.flush() in Python;
  • see documentation for other languages.
翻译中…

Note

翻译中…

For the first query, the answer is negative since the second set does not contain a segment that lies on the segment $[2, 3]$.

翻译中…

In the second query, the first set contains $[2, 3]$, and the second set contains $[2, 4]$.

翻译中…

In the third query, the first set contains $[2, 3]$, the second set contains $[2, 4]$, and the third set contains $[2, 5]$.

翻译中…

In the fourth query, the second set does not contain a segment that lies on the segment $[3, 6]$.

翻译中…

In the fifth query, the second set contains $[2, 4]$, the third set contains $[2, 5]$, and the fourth contains $[7, 9]$.

翻译中…

样例

Input #1
5 5 9
3 6 3
1 3 1
2 4 2
1 2 3
4 6 5
2 5 3
7 9 4
2 3 1
4 10 4
1 2 2 3
1 2 2 4
1 3 1 5
2 3 3 6
2 4 2 9
Output #1
no
yes
yes
no
yes
InputCopy OutputCopy
题目信息
题号
1080F
时间限制
3.5 s
内存限制
512 MB
标签
数据结构
交互题
排序

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。