轰炸III

该比赛已结束,您无法在比赛模式下递交该题目。您可以点击“在题库中打开”以普通模式查看和递交本题。

Background

A city of size n×mn\times m suffered xx bombings. Each time, a rectangle whose sides are parallel to the borders was bombed.

Problem Description

After the bombings, there are yy key points. The commander wants to know whether each of them was ever bombed; if yes, how many times, and in which round the last time occurred.

Input Format

The first line contains four integers, n,m,x,yn,m,x,y.

The next xx lines each contain four integers x1,y1,x2,y2x_1,y_1,x_2,y_2, representing the top-left and bottom-right coordinates of the bombed rectangle (for example, 1,3,7,101,3,7,10 means the bombed area is the rectangle from (1,3)(1,3) to (7,10)(7,10)).

The next yy lines each contain two integers, representing the coordinates of a key point.

Output Format

Output yy lines. In each line, the first character is Y or N, indicating whether it was bombed; if it is Y, then after a single space output two integers: the number of times it was bombed and the round number of the last time.

10 10 2 3
1 1 5 5
5 5 10 10
3 2
5 5
7 1

Y 1 1
Y 2 2
N

Hint

For 100%100\% of the testdata, 1n,m1001\le n,m\le 100.

Translated by ChatGPT 5

第 24 课:模拟算法

未认领
状态
已结束
题目
15
开始时间
2026-7-6 22:00
截止时间
2026-7-13 22:00
可延期
24 小时