QOJ.ac

QOJ

Límite de tiempo: 5.0 s Límite de memoria: 256 MB Puntuación total: 100

#19998. 四点组

Estadísticas

“我有一条原则,”经理说,“永远只做一半的工作。”

“你为什么有这样的原则?”Cheburashka 问。

“很简单,”Ivan Ivanovich 说,“如果我把所有工作都做完,什么都同意,那么大家就会说我太好说话,在我手下可以为所欲为。反过来,如果我什么工作都不做,什么都拒绝,大家就会觉得我懒惰,基本上一无是处。所以,只做一半工作是最理想的,因为谁都说不了我的坏话。现在你明白了吗?”

E. Uspenskiy,《鳄鱼 Gena 和他的朋友们》

Flatland 的地质学家正在计划一项重要的研究。为此,他们准备了 $n$ 组点,并打算在这些点上进行测量。每组包含四个不同的点,用二维坐标表示。

准备好的这些点组必须得到 $m$ 位经理的批准。每位经理选择一个边平行于坐标轴的矩形,并批准在矩形内部或边界上的所有点进行测量。

如果对于给定的每组点,一位经理都恰好批准了其中一半的点,就称这位经理是出色的。判断每位经理是否出色。

输入格式

第一行包含两个整数 $n$ 和 $m$,分别表示点组数和经理数($1 \le n \le 200\,000$,$1 \le m \le 200\,000$)。接下来有 $n$ 组行,每组四行。每行包含两个整数,表示下一个点的坐标。每组中的点两两不同。接下来的 $m$ 行描述矩形,每行四个整数 $x_1,y_1,x_2,y_2$($x_1 \le x_2$,$y_1 \le y_2$)。

所有坐标的绝对值均不超过 $10^9$。

输出格式

对于每位经理,如果对于给定的每组点,他都恰好批准了其中一半的点,则输出“YES”,否则输出“NO”。

样例

输入格式 1

2 3
0 0
0 1
1 0
1 2
2 0
2 -1
2 -2
2 -3
0 -1 2 0
0 -1 2 1
0 0 0 1

输出格式 1

YES
NO
NO

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.