#if __INCLUDE_LEVEL__ == 0 #include __BASE_FILE__ namespace { using kactl::P; void solve() { int q; scan(q); P A, B, C; scan(A.x, A.y, B.x, B.y, C.x, C.y); const auto [o, r] = kactl::mec({A, B, C}); while (q--) { P p; scan(p.x, p.y); const bool ans = (p - o).dist() < r + 1e-10; print(ans ? "Yes" : "No"); } } } // namespace int main() { std::ios::sync_with_stdio(false); std::cin.tie(nullptr); solve(); } #else // __INCLUDE_LEVEL__ #include // https://github.com/kth-competitive-programming/kactl namespace kactl { using namespace std; #define rep(i, a, b) for (int i = a; i < (b); ++i) #define all(x) begin(x), end(x) #define sz(x) (int)(x).size() typedef long long ll; typedef pair pii; typedef vector vi; template int sgn(T x) { return (x > 0) - (x < 0); } template struct Point { typedef Point P; T x, y; explicit Point(T x = 0, T y = 0) : x(x), y(y) {} bool operator<(P p) const { return tie(x, y) < tie(p.x, p.y); } bool operator==(P p) const { return tie(x, y) == tie(p.x, p.y); } P operator+(P p) const { return P(x + p.x, y + p.y); } P operator-(P p) const { return P(x - p.x, y - p.y); } P operator*(T d) const { return P(x * d, y * d); } P operator/(T d) const { return P(x / d, y / d); } T dot(P p) const { return x * p.x + y * p.y; } T cross(P p) const { return x * p.y - y * p.x; } T cross(P a, P b) const { return (a - *this).cross(b - *this); } T dist2() const { return x * x + y * y; } double dist() const { return sqrt((double)dist2()); } double angle() const { return atan2(y, x); } P unit() const { return *this / dist(); } P perp() const { return P(-y, x); } P normal() const { return perp().unit(); } P rotate(double a) const { return P(x * cos(a) - y * sin(a), x * sin(a) + y * cos(a)); } friend ostream& operator<<(ostream& os, P p) { return os << "(" << p.x << "," << p.y << ")"; } }; typedef Point P; double ccRadius(const P& A, const P& B, const P& C) { return (B - A).dist() * (C - B).dist() * (A - C).dist() / abs((B - A).cross(C - A)) / 2; } P ccCenter(const P& A, const P& B, const P& C) { P b = C - A, c = B - A; return A + (b * c.dist2() - c * b.dist2()).perp() / b.cross(c) / 2; } pair mec(vector

ps) { shuffle(all(ps), mt19937(time(0))); P o = ps[0]; double r = 0, EPS = 1 + 1e-8; rep(i, 0, sz(ps)) if ((o - ps[i]).dist() > r * EPS) { o = ps[i], r = 0; rep(j, 0, i) if ((o - ps[j]).dist() > r * EPS) { o = (ps[i] + ps[j]) / 2; r = (o - ps[i]).dist(); rep(k, 0, j) if ((o - ps[k]).dist() > r * EPS) { o = ccCenter(ps[i], ps[j], ps[k]); r = (o - ps[i]).dist(); } } } return {o, r}; } #undef sz #undef all #undef rep } // namespace kactl template bool chmin(T& x, U&& y) { return y < x && (x = std::forward(y), true); } template bool chmax(T& x, U&& y) { return x < y && (x = std::forward(y), true); } template T inf() { T ret; std::memset(&ret, 0x3f, sizeof(ret)); return ret; } template T inf() { return std::numeric_limits::infinity(); } template concept Range = std::ranges::range && !std::convertible_to; template concept TupleLike = std::__is_tuple_like::value && !Range; namespace std { istream& operator>>(istream& is, Range auto&& r) { for (auto&& e : r) { is >> e; } return is; } istream& operator>>(istream& is, TupleLike auto&& t) { return apply([&](auto&... xs) -> istream& { return (is >> ... >> xs); }, t); } ostream& operator<<(ostream& os, Range auto&& r) { string_view sep = ""; for (auto&& e : r) { os << exchange(sep, " ") << e; } return os; } ostream& operator<<(ostream& os, TupleLike auto&& t) { const auto f = [&](auto&... xs) -> ostream& { [[maybe_unused]] string_view sep = ""; ((os << exchange(sep, " ") << xs), ...); return os; }; return apply(f, t); } #define DEF_INC_OR_DEC(op) \ auto& operator op(Range auto&& r) { \ for (auto&& e : r) { \ op e; \ } \ return r; \ } \ auto& operator op(TupleLike auto&& t) { \ apply([](auto&... xs) { (op xs, ...); }, t); \ return t; \ } DEF_INC_OR_DEC(++) DEF_INC_OR_DEC(--) #undef DEF_INC_OR_DEC } // namespace std void scan(auto&&... xs) { std::cin >> std::tie(xs...); } void print(auto&&... xs) { std::cout << std::tie(xs...) << '\n'; } #define FWD(...) static_cast(__VA_ARGS__) template class fix { public: explicit fix(F f) : f_(std::move(f)) {} decltype(auto) operator()(auto&&... xs) const { return f_(std::ref(*this), FWD(xs)...); } private: F f_; }; template concept LambdaExpr = std::is_placeholder_v> != 0 || std::is_bind_expression_v>; auto operator++(LambdaExpr auto&& x, int) { return std::bind([](auto&& x) -> decltype(auto) { return FWD(x)++; }, FWD(x)); } auto operator--(LambdaExpr auto&& x, int) { return std::bind([](auto&& x) -> decltype(auto) { return FWD(x)--; }, FWD(x)); } #define DEF_UNARY_OP(op) \ auto operator op(LambdaExpr auto&& x) { \ return std::bind([](auto&& x) -> decltype(auto) { return op FWD(x); }, FWD(x)); \ } DEF_UNARY_OP(++) DEF_UNARY_OP(--) DEF_UNARY_OP(+) DEF_UNARY_OP(-) DEF_UNARY_OP(~) DEF_UNARY_OP(!) DEF_UNARY_OP(*) DEF_UNARY_OP(&) #undef DEF_UNARY_OP #define DEF_BINARY_OP(op) \ template \ requires LambdaExpr || LambdaExpr \ auto operator op(T1&& x, T2&& y) { \ return std::bind([](auto&& x, auto&& y) -> decltype(auto) { return FWD(x) op FWD(y); }, \ FWD(x), FWD(y)); \ } DEF_BINARY_OP(+=) DEF_BINARY_OP(-=) DEF_BINARY_OP(*=) DEF_BINARY_OP(/=) DEF_BINARY_OP(%=) DEF_BINARY_OP(^=) DEF_BINARY_OP(&=) DEF_BINARY_OP(|=) DEF_BINARY_OP(<<=) DEF_BINARY_OP(>>=) DEF_BINARY_OP(+) DEF_BINARY_OP(-) DEF_BINARY_OP(*) DEF_BINARY_OP(/) DEF_BINARY_OP(%) DEF_BINARY_OP(^) DEF_BINARY_OP(&) DEF_BINARY_OP(|) DEF_BINARY_OP(<<) DEF_BINARY_OP(>>) DEF_BINARY_OP(==) DEF_BINARY_OP(!=) DEF_BINARY_OP(<) DEF_BINARY_OP(>) DEF_BINARY_OP(<=) DEF_BINARY_OP(>=) DEF_BINARY_OP(&&) DEF_BINARY_OP(||) #undef DEF_BINARY_OP template requires LambdaExpr || LambdaExpr auto at(T1&& x, T2&& y) { return std::bind([](auto&& x, auto&& y) -> decltype(auto) { return FWD(x)[FWD(y)]; }, FWD(x), FWD(y)); } template auto get(LambdaExpr auto&& x) { return std::bind([](auto&& x) -> decltype(auto) { return std::get(FWD(x)); }, FWD(x)); } inline auto rep(int l, int r) { return std::views::iota(std::min(l, r), r); } inline auto rep(int n) { return rep(0, n); } inline auto rep1(int l, int r) { return rep(l, r + 1); } inline auto rep1(int n) { return rep(1, n + 1); } using namespace std::literals; using namespace std::placeholders; namespace ranges = std::ranges; namespace views = std::views; using i64 = std::int64_t; #endif // __INCLUDE_LEVEL__