This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
#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;//关键点
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;//因为要下一轮所以计数器清零