#include #include #include using namespace std; struct Point { long double x, y; Point(): x(0), y(0) {} Point(long double x0, long double y0): x(x0), y(y0) {} long double dist(const Point & other) { return hypot(other.x - x, other.y - y); } }; struct Vector { long double x, y; Vector(): x(0), y(0) {} Vector(long double x0, long double y0): x(x0), y(y0) {} Vector(const Point & A, const Point & B) { x = B.x - A.x; y = B.y - A.y; } long double dist() { return hypot(x, y); } }; long double dot_product(const Vector & a, const Vector & b) { return a.x * b.x + a.y * b.y; } long double cross_product(const Vector & a, const Vector & b) { return a.x * b.y - a.y * b.x; } Vector operator + (const Vector & a, const Vector & b) { return Vector(a.x + b.x, a.y + b.y); } long double operator * (const Vector & a, const Vector & b) { return a.x * b.x + a.y * b.y; } ostream & operator << (ostream & out, const Vector & a) { out << a.x << " " << a.y; return out; } istream & operator >> (istream & in, Vector & a) { in >> a.x >> a.y; return in; } istream & operator >> (istream & in, Point & a) { in >> a.x >> a.y; return in; } int main() { Point P, A, B; ofstream fout("output.txt"); cin >> P >> A >> B; Vector AB(A, B); Vector AP(A, P); if (AB.cross_product(AP) == 0 && AB.dot_product(AP) >= 0) cout << "YES" << endl; else cout << "NO" << endl; fout << AB << endl; fout.close(); return 0; }