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.