You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
828 B

2 years ago
#include <bits/stdc++.h>
using namespace std;
long long tot, ans, n, m;//tot是累计ans是最后一次
int main() {
cin >> m >> n;
long long a[n + 1], b[n + 1], x[n + 1], y[n + 1], i, j;//轰炸坐标定位ij为关键点的坐标
for (int k = 1; k <= m; k++)
cin >> a[k] >> b[k] >> x[k] >> y[k]; //读入
for (int o = 1; o <= n; o++) {
cin >> i >> j;//关键点
for (int k = 1; k <= m; k++)
if (i >= a[k] && i <= x[k] && j >= b[k] && j <= y[k])//如果在这个范围内
{
tot++;//累计
ans = k;//覆盖
}
if (tot == 0)cout << "NO" << endl;
else cout << "YES" << " " << tot << " " << ans << endl;//如果累计为1 NO,反之
tot = 0;//因为要下一轮所以计数器清零
}
}