#include #define elif else if #define ll long long #define vll vector #define vec vector #define embk emplace_back #define rep(i, n) for (ll i = 0; i < n; i++) #define rep3(i, n, k) for (ll i = k; i < n; i++) #define all(a) a.begin(), a.end() #define YNeos(bool) (bool ? "Yes" : "No") #define vllin(a, n) vll a(n); rep(i, n) cin >> a[i] #define vchin(a, n) vec a(n); rep(i, n) cin >> a[i] using namespace std; const ll INF = 1LL << 60; const ll mod = 998244353; //const ll mod = 1000000007; const double pi = acos(-1); const double EPS = 1 / 1000000000; //10^-9 //#ifdef ATCODER #include using namespace atcoder; using mint = modint998244353; //#endif //Prototype declaration template void gin(T&&, U&&...); template vector read(ll); template void printvec(const T&); template void printany(T&&, U&&...); //Main Program int main() { ll q; cin >> q; vec> abc(3); rep(i, 3) { double x, y; gin(x, y); abc[i] = make_pair(x, y); } sort(all(abc)); bool isonline = 0; double slope_13, itcpt_13, slope_12, itcpt_12, nor_slope_13, nor_itcpt_13, nor_slope_12, nor_itcpt_12, rad; pair center; if ((abc[0].first == abc[1].first && abc[0].first == abc[2].first) || (abc[0].second == abc[1].second && abc[0].second == abc[2].second)) isonline = 1; if (!isonline) { slope_13 = (abc[2].second - abc[0].second) / (abc[2].first - abc[0].first); itcpt_13 = abc[0].second - abc[0].first * slope_13; if (abc[1].second - (slope_13 * abc[1].first + itcpt_13) < EPS) isonline = 1; } if (!isonline) { slope_12 = (abc[1].second - abc[0].second) / (abc[1].first - abc[0].first); itcpt_12 = abc[0].second - abc[0].first * slope_13; nor_slope_12 = -1 / slope_12; nor_slope_13 = -1 / slope_13; nor_itcpt_12 = (abc[0].second + abc[1].second) / 2 + (abc[0].first + abc[1].first) / (slope_12 * 2); nor_itcpt_13 = (abc[0].second + abc[2].second) / 2 + (abc[0].first + abc[2].first) / (slope_13 * 2); double centerx = (nor_itcpt_12 - nor_itcpt_13) / (nor_slope_12 - nor_slope_13); center = make_pair(centerx, nor_slope_12 * centerx + nor_itcpt_12); rad = (center.first - abc[0].first) * (center.first - abc[0].first) + (center.second - abc[0].second) * (center.second - abc[0].second); } if (isonline) { center = make_pair((abc[0].first + abc[2].first) / 2, (abc[0].second + abc[2].second) / 2); rad = (center.first - abc[0].first) * (center.first - abc[0].first) + (center.second - abc[0].second) * (center.second - abc[0].second); } rep (itr, q) { double x, y; gin(x, y); ll kyori = (center.first - x) * (center.first - x) + (center.second - y) * (center.second - y); cout << YNeos(kyori <= rad) << endl; } } //Function Definition void gin() {return;} template void gin(T&& now, U&&... next) { cin >> now; gin(forward (next)...); } template vector read(ll n) { vector v(n); for (int i = 0; i < n; i++) cin >> v[i]; return v; } template void printvec(const T& a) { for (int i = 0; i < a.size(); i++) { cout << a[i]; if (i == a.size() - 1) cout << endl; else cout << ' '; } } void printany() {cout << endl;} template void printany(T&& now, U&&... next) { cout << now << ' '; printany(forward (next)...); }