Curtains

아직 제출이 없습니다시간 제한1.5초메모리 제한1024 MB

문제

Benson the Rabbit is organizing a performance on his plane!

He has a stage with nn sections numbered 11 to nn from left to right. He also has mm curtains numbered from 11 to mm.

Each of these mm curtains can be lowered. Lowering curtain ii covers sections l\[i]l\[i] to r\[i]r\[i]. A curtain configuration is a set of lowered curtains. Given a curtain configuration, a section xx (1xn1 ≤ x ≤ n) is covered if and only if there exists a lowered curtain ii such that l\[i]xr\[i]l\[i] ≤ x ≤ r\[i].

Benson wants to give a total of qq performances, numbered from 11 to qq. For each performance jj, Benson requires a curtain configuration such that the sections s\[j]s\[j] to e\[j]e\[j] are covered and nothing else is covered. More formally, for each 1xn1 ≤ x ≤ n,

  • If s\[j]xe\[j]s\[j] ≤ x ≤ e\[j], section xx is covered.
  • Otherwise, section xx is not covered.

For each of these qq performances, help Benson to determine if there exists a curtain configuration satisfying his requirements.

입력

The first line of input will contain 33 spaced integers nn, mm and qq, representing the number of sections, curtains and performances respectively.

The next mm lines of input will contain 22 spaced integers each. The ii-th of these lines will contain l\[i]l\[i] and r\[i]r\[i] respectively, describing the range of sections that curtain ii can cover.

The next qq lines of input will contain 22 spaced integers each. The jj-th of these lines will contain s\[j]s\[j] and e\[j]e\[j] respectively, describing the range of sections that need to be covered for performance jj.

출력

Output qq lines, the jj-th of which should contain YES if it is possible to cover the required sections for the jj-th performance using the curtains, and NO otherwise.

제한

  • 1n,m,q500,0001 ≤ n, m, q ≤ 500\\,000
  • 1l\[i]r\[i]n1 ≤ l\[i] ≤ r\[i] ≤ n (for all 1im1 ≤ i ≤ m)
  • 1s\[j]e\[j]n1 ≤ s\[j] ≤ e\[j] ≤ n (for all 1jq1 ≤ j ≤ q)