QOJ.ac

QOJ

Time Limit: 5.0 s Memory Limit: 256 MB Total points: 100

#19998. 四點組

Statistics

「我有一條原則,」經理說,「永遠只做一半的工作。」

「你為什麼有這樣的原則?」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.