Untitled

 avatar
unknown
plain_text
4 years ago
1.3 kB
4
Indexable
/* Authors: Phan Quy Thinh - Chu Van An High School for the Gifted, Binh Dinh */
// 15092021
#include<bits/stdc++.h>
#define task "task."

using namespace std;

#define maxn 300009
#define ll long long
#define endl "\n"
#define fi first
#define se second
#ifndef ONLINE_JUDGE
ifstream fi(task"inp");
ofstream fo(task"out");
#define cin fi
#define cout fo
#endif // ONLINE_JUDGE

typedef pair<int,int> ii;
ii a,b,c;

void init()
{
    int x,y;
    cin>>x>>y; a={x,y};
    cin>>x>>y; b={x,y};
    cin>>x>>y; c={x,y};
}

bool sub_A()
{
    int ans=(a.se-b.se)*c.fi+(b.fi-a.fi)*c.se+(a.fi*b.se-a.se*b.fi);
    return (ans==0) ? true : false;
}

bool checkpos(int x,int y,int m)
{
    return (min(x,y)<=m && m<=max(x,y)) ? true : false;
}
bool sub_B()
{
    if (sub_A()==false) return false;
    return (checkpos(a.fi,b.fi,c.fi) && checkpos(a.se,b.se,c.se)) ? true : false;
}

bool sub_C()
{
    if (sub_A()==false) return false;
    return ((c.fi-a.fi)*(b.fi-a.fi)>=0 && (c.se-a.se)*(b.se-a.se)>=0) ? true : false;
}

void solve()
{
    sub_A() ? cout<<"Yes"<<endl : cout<<"No"<<endl;
    sub_B() ? cout<<"Yes"<<endl : cout<<"No"<<endl;
    sub_C() ? cout<<"Yes"<<endl : cout<<"No"<<endl;
}

int main()
{
    init();
    solve();
}
Editor is loading...