temp
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define ordered_set tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update>
#define ll long long int
#define llu unsigned long long int
#define pi 3.14159265359
#define lcm(x, y) (x / gcd(x, y)) * y
#define sin(x) sin((x / 180.0) * pi)
#define cos(x) cos((x / 180.0) * pi)
#define tan(x) tan((x / 180.0) * pi)
#define len(x1, y1, x2, y2) hypot(x1 - x2, y1 - y2)
#define sorta(v) sort(v.begin(), v.end())
#define sortd(v) sort(v.begin(), v.end(), greater<>())
#define min_el(v) (*min_element((v).begin(), (v).end()))
#define max_el(v) (*max_element((v).begin(), (v).end()))
#define sum(v) (accumulate((v).begin(), (v).end(), 0ll))
#define uniq(v) v.erase(unique(v.begin(), v.end()), v.end());
#define min_eli(v) (min_element((v).begin(), (v).end()) - (v).begin())
#define max_eli(v) (max_element((v).begin(), (v).end()) - (v).begin())
#define lowb(v, e) (lower_bound((v).begin(), (v).end(), (e)) - (v).begin())
#define upb(v, e) (upper_bound((v).begin(), (v).end(), (e)) - (v).begin())
// int mark[10000001], cnt = 0;
// long long int primeList[1000000];
// void sieve() {
// int n = 10000000;
// mark[1] = 1;
// for (int i = 4; i <= n; i += 2) mark[i] = 1;
// primeList[cnt] = 2, cnt++;
// for (int i = 3; i <= n; i += 2) {
// if (mark[i] == 0) {
// primeList[cnt] = i, cnt++;
// if (i <= sqrt(n)) {
// for (int j = i * 2; j <= n; j += i) mark[j] = 1;
// }
// }
// }
// }
// LowerBound
// ll l = -1, r = n;
// while (l + 1 < r) {
// ll mid = (l + r) / 2;
// if (arr[mid] >= q) {
// r = mid;
// } else {
// l = mid;
// }
// }
// cout << r + 1 << endl;
// ll LowerBound = lower_bound(arr, arr+n, q)-arr;
// cout<<LowerBound<<endl;
// UpperBound
// ll l = -1, r = n;
// while (l + 1 < r) {
// ll mid = (l + r) / 2;
// if (arr[mid] > q) {
// r = mid;
// } else {
// l = mid;
// }
// }
// cout << r << endl;
// ll UpperBound = upper_bound(arr, arr+n, q)-arr;
// cout<<UpperBound<<endl;
void solve() {
ll x1, y1, r, n;
cin >> x1 >> y1 >> r >> n;
// vector<ll> vc(n);
// for (int i = 0; i < n; i++) cin >> vc[i];
double ar = pi * (r * r);
while (n--) {
ll a, b;
cin >> a >> b;
double l = len(x1, y1, a, b);
double ar2 = pi * (l * l);
if (ar < ar2)
cout << "NO" << endl;
else
cout << "YES" << endl;
}
}
void T() {
ll t;
cin >> t;
while (t--) {
solve();
}
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
// T();
solve();
return 0;
}
Comments
Post a Comment