#include <bits/stdc++.h>
#define pb push_back
#define pf push_front
using namespace std;
#define F first
#define S second
typedef long long ll;
#define pii pair <int, int>
#define pll pair <ll, ll>
typedef long double ld;
const ll N = 1e5 + 100, M = 4096 + 10, len = 21, inf = 1e18;
const ll mod = 1e9 + 7;
ll um(ll a, ll b){
return (1LL * a * b) % mod;
}
ll subr(ll a, ll b){
return ((1LL * a - b) % mod + mod) % mod;
}
int a[N], b[N];
int main(){
ios::sync_with_stdio(false);
cin.tie(NULL);
int n, q, ans = 0;
cin >> n >> q;
for(int i = 0; i < n; i++){
cin >> a[i] >> b[i];
}
for(int i = 0, x, y, z; i < q; i++){
cin >> x >> y >> z;
ans = 0;
for(int j = 0; j < n; j++){
if(a[j] >= x && b[j] >= y && a[j] + b[j] >= z) ans++;
}
cout << ans << endl;
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |