//#include <bits/stdc++.h>
#include <iostream>
#include <iomanip>
#include <bitset>
#include <string>
#include <set>
#include <stack>
#include <sstream>
#include <list>
#include <array>
#include <vector>
#include <queue>
#include <map>
#include <memory>
#include <iterator>
#include <climits>
#include <cassert>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <algorithm>
using namespace std;
#define FAST_IO ios::sync_with_stdio(false),cin.tie(0),cout.tie(0)
#define all(x) (x).begin(), (x).end()
typedef long long ll;
typedef unsigned int UINT;
typedef unsigned long long ull;
typedef pair<int, int> pdi;
typedef pair<ll, int> pli;

int const maxn = 1e3 + 10;
inline int lc(int x)  {return x << 1;}
inline int rc(int x)  {return x << 1 | 1;}

int m[maxn][maxn];

int main(void) {
    FAST_IO;

    int n;
    cin >> n;
    for (int i = 1; i <= n; i++) {
        for (int j = 1; j <= n; j++) {
            cin >> m[i][j];
        }
    }
    int x = 0;
    for (int i = 1; i <= n; i++) {
        x = __gcd(m[1][i], x);
    }
    int ans = x;
    for (int i = 1; i * i <= x; i++) {
        if (x % i == 0) {
            int y = x / i;
            int flag = 0;
            for (int j = 1; j <= n; j++) {
                if (m[1][j] % i != 0) {
                    flag = 1;
                    break;
                }
            }
            if (!flag) ans = i;
            flag = 0;
            for (int j = 1; j <= n; j++) {
                if (m[1][j] % y != 0) {
                    flag = 1;
                    break;
                }
            }
            if (!flag) ans = y;
        }
    }
    cout << ans;
    for (int i = 2; i <= n; i++) {
        cout << " " << m[1][i] / ans;
    }
    cout << endl;
    return 0;
}


#include<iostream>
#include<algorithm>
#include<queue>
#include<stack>
#include<cstdio>
#include<string>
#include<cstring>
#include<vector>
// #include<map>
#include<cmath>
#include<list>
#define ll long long
#define N 100005
#define pb push_back
#define Sca(a) scanf("%d",&a)
#define Scs(a) scanf("%s",&a)
#define mem0(a) memset(a,0,sizeof(a))
#define mem1(a) memset(a,-1,sizeof(a))
#define Scal(a) scanf("%ld",&a)
#define Scall(a) scanf("%lld",&a)
#define Pri(a) printf("%d",a)
#define Prs(a) printf("%s",a)
#define Pril(a) printf("%ld",a)
#define Prill(a) printf("%lld",a)
#define FAST_IO ios::sync_with_stdio(false)
using namespace std;
const int INF = 0x3f3f3f3f;
const ll INFL = 0x3f3f3f3f3f3f3f3f;
const int MOD = 1e9 + 7;
const double pi = 3.141592653;
using namespace std;
template <class T>void tomax(T&a, T b) {
	a = max(a, b);
}
template <class T>void tomin(T&a, T b) {
	a = min(a, b);
}
int a[1005];
double  b[1005];
int gcd(int a, int b) {
	if (b == 0) return a;
	else return gcd(b % a, a);
}
int main() {
	int n;
	// cout<<__gcd(99990000,99970002)<<endl;
	cin >> n;

	for (int i = 1; i <= n; i++) {
		if (i == 1) {
			for (int j = 0; j < n; j++) {
				cin >> a[j];
			}
			sort(a, a + n);
			int k, temp, temp2;
			for (int j = 0; j < n; j++) if (a[j] != 0) {temp = a[j]; k = j; break;}
			for (int j = k; j < n; j++) if (a[j] != temp) {temp2 = a[j]; break;}
			// cout<<temp<<" "<<temp2<<endl;
			int ggg = __gcd(temp, temp2);
			b[i] = ggg;
		} else for (int j = 1; j <=n; j++) {
				cin >> a[j];
				if (j == i - 1) b[i] = a[j] / b[i - 1];
			}
	}
	for (int i = 1; i < n; i++) cout << b[i] << " ";
	cout << b[n] << endl;
}


//#include <bits/stdc++.h>
#include <iostream>
#include <iomanip>
#include <bitset>
#include <string>
#include <set>
#include <stack>
#include <sstream>
#include <list>
#include <array>
#include <vector>
#include <queue>
#include <map>
#include <memory>
#include <iterator>
#include <climits>
#include <cassert>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <algorithm>
using namespace std;
#define FAST_IO ios::sync_with_stdio(false),cin.tie(0),cout.tie(0)
#define all(x) (x).begin(), (x).end()
typedef long long ll;
typedef unsigned int UINT;
typedef unsigned long long ull;
typedef pair<int, int> pdi;
typedef pair<ll, int> pli;

int const maxn = 1e3 + 10;
inline int lc(int x)  {return x << 1;}
inline int rc(int x)  {return x << 1 | 1;}

int m[maxn][maxn];

int main(void) {
    FAST_IO;

    int n;
    cin >> n;
    for (int i = 1; i <= n; i++) {
        for (int j = 1; j <= n; j++) {
            cin >> m[i][j];
        }
    }
    int x = 0;
    for (int i = 1; i <= n; i++) {
        x = __gcd(m[1][i], x);
    }
    int ans = x;
    for (int i = x - 1; i >= 2; i--) {
        if (x % i == 0) {
            int flag = 0;
            for (int j = 1; j <= n; j++) {
                if (m[1][j] % i != 0) {
                    flag = 1;
                    break;
                }
            }
            if (!flag) {
                ans = i;
                break;
            }
        }
    }
    cout << ans;
    for (int i = 2; i <= n; i++) {
        cout << " " << m[1][i] / ans;
    }
    cout << endl;
    return 0;
}


#include<iostream>
#include<algorithm>
#include<queue>
#include<stack>
#include<cstdio>
#include<string>
#include<cstring>
#include<vector>
// #include<map>
#include<cmath>
#include<list>
#define ll long long
#define N 100005
#define pb push_back
#define Sca(a) scanf("%d",&a)
#define Scs(a) scanf("%s",&a)
#define mem0(a) memset(a,0,sizeof(a))
#define mem1(a) memset(a,-1,sizeof(a))
#define Scal(a) scanf("%ld",&a)
#define Scall(a) scanf("%lld",&a)
#define Pri(a) printf("%d",a)
#define Prs(a) printf("%s",a)
#define Pril(a) printf("%ld",a)
#define Prill(a) printf("%lld",a)
#define FAST_IO ios::sync_with_stdio(false)
using namespace std;
const int INF = 0x3f3f3f3f;
const ll INFL = 0x3f3f3f3f3f3f3f3f;
const int MOD = 1e9 + 7;
const double pi = 3.141592653;
using namespace std;
template <class T>void tomax(T&a, T b) {
	a = max(a, b);
}
template <class T>void tomin(T&a, T b) {
	a = min(a, b);
}
int a[1005],b[1005];
int gcd(int a,int b){
	if(b==0) return a;
	else return gcd(b % a,a);
}
int main(){
	int n;
	// cout<<__gcd(99990000,99970002)<<endl;
	cin>>n;

	for(int i=1;i<=n;i++){
		for(int j=0;j<n;j++){
			cin>>a[j];
		}
		sort(a,a+n);
		int k,temp,temp2;
		for(int j=0;j<n;j++) if(a[j]!=0){temp=a[j];k=j;break;}
		for(int j=k;j<n;j++) if(a[j]!= temp) {temp2=a[j];break;}
		// cout<<temp<<" "<<temp2<<endl;
		b[i]=__gcd(temp,temp2);
	}
	for(int i=1;i<n;i++) cout<<b[i]<<" ";
	cout<<b[n]<<endl;
}


#include <algorithm>
#include <bitset>
#include <cassert>
#include <chrono>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <limits>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <ratio>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
using namespace std;

int floorSqrt(int x)
{
    if (x == 0 || x == 1)
       return x;

    int start = 1, end = x, ans;
    while (start <= end)
    {
        int mid = (start + end) / 2;

        if (mid*mid == x)
            return mid;

        if (mid*mid < x)
        {
            start = mid + 1;
            ans = mid;
        }
        else
            end = mid-1;
    }
    return ans;
}

int main(){
	int a[1007][1007];
	int n, first;
	cin >> n;
	for(int i = 0; i < n; i++){
		for(int j = 0; j < n; j++){
			cin >> a[i][j];
		}
	}
	first = floorSqrt( ((a[0][1] * a[0][2]) / a[1][2]) );
	cout << first << " ";
	for(int i = 1; i < n; ++i){
		cout << a[0][i] / first;
		if(i != n-1)
			cout << " ";
		else
			cout << endl;
	}
}


#include <algorithm>
#include <bitset>
#include <cassert>
#include <chrono>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <limits>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <ratio>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
using namespace std;

long long int floorSqrt(long long int x)
{
    if (x == 0 || x == 1)
       return x;

    long long int start = 1, end = x, ans;
    while (start <= end)
    {
        long long int mid = (start + end) / 2;

        if (mid*mid == x)
            return mid;

        if (mid*mid < x)
        {
            start = mid + 1;
            ans = mid;
        }
        else
            end = mid-1;
    }
    return ans;
}

int main(){
	long long int a[1007][1007];
	long long int n, first;
	cin >> n;
	for(int i = 0; i < n; i++){
		for(int j = 0; j < n; j++){
			cin >> a[i][j];
		}
	}
	if( ( (a[0][1] * a[0][2]) % a[1][2]) == 0)
		first = floorSqrt( ((a[0][1] * a[0][2]) / a[1][2]) );
	else if (a[0][2] % a[1][2] == 0)
		first = floorSqrt( (a[0][1] * (a[0][2] / a[1][2]) ) );
	else
		first = floorSqrt( ((a[0][1] / a[1][2]) * a[0][2]) );
	cout << first << " ";
	for(int i = 1; i < n; ++i){
		cout << a[0][i] / first;
		if(i != n-1)
			cout << " ";
		else
			cout << endl;
	}
}


#include <stdio.h>
#include <algorithm>
#include <stdlib.h>

using namespace std;

#define MAXH 16

class PT{
    public:
        long long x,y;
        PT(){}
        PT(long long _x,long long _y) {
            x = _x; y = _y;
        }
        PT operator+(const PT& p) const {
            return PT(x+p.x,y+p.y);
        }
        PT operator-(const PT& p) const {
            return PT(x-p.x,y-p.y);
        }
        long long operator^(const PT& p) const {
            return x*p.y-y*p.x;
        }
};

class ND{
    public:
        ND* nx[MAXH+1];
        ND* pr[MAXH+1];
        PT p;
        int h;
        ND() {}
        ND(const PT& _p,int _h=0) {
            int x,i;
            if(_h) {
                h = _h;
            }else {
                x = rand()&((1<<MAXH)-1);
                for( h=0; x&(1<<h); h++ );
            }
            p = _p;
            for( i=0; i<=h; i++ ) {
                nx[i] = pr[i] = this;
            }
        }
        void insert(ND* d,int s=0) {
            int i;
            for( i=s; i<=h && i<=d->h; i++ ) {
                d->nx[i] = nx[i];
                d->pr[i] = this;
                nx[i]->pr[i] = d;
                nx[i] = d;
            }
        }
        ND* del() {
            int i;
            ND* t;
            t = nx[0];
            for( i=0; i<=h; i++ ) {
                nx[i]->pr[i] = pr[i];
                pr[i]->nx[i] = nx[i];
            }
            //free(this);
            return t;
        }
        void prt() {
            ND *t;
            t = this;
            do {
                printf("%lld %lld  %d\n",t->p.x,t->p.y,t->h);
                t = t->nx[0];
            }while(t!=nx[h]);
        }
};

ND *head;

inline long long tri(PT p1,PT p2,PT p3) {
    return (p2-p1)^(p3-p1);
}

inline int inside(PT p) {
    ND *L,*R,*M;
    int h;
    L = head;
    R = head->pr[0];
    if(tri(R->p,L->p,p)<0) return 0;
    h = L->h;
    while(L->nx[h]==L) h--;
    while(1) {
        while(h>=0 && (M=L->nx[h])==R) h--;
        if(h<0) break;
        if(tri(L->p,M->p,p)<0) {
            R = M;
        }else if(tri(M->p,R->p,p)<0) {
            L = M;
        }else {
            return 1;
        }
    }
    return 0;
}

inline void insert(PT p) {
    ND *L,*R,*M;
    int h;
    L = head;
    R = head->pr[0];
    if(tri(R->p,L->p,p)<0) {
        swap(L,R);
        while(tri(L->pr[0]->p,L->p,p)<=0) L = L->del()->pr[0];
        if(tri(R->p,R->nx[0]->p,p)<=0) {
            R = R->nx[0];
            while(tri(R->p,R->nx[0]->p,p)<=0) R = R->del();
            head->p = p;
        }else {
            L->insert(new ND(p));
        }
    }else {
        h = L->h;
        while(L->nx[h]==L) h--;
        while(1) {
            while(h>=0 && (M=L->nx[h])==R) h--;
            if(h<0) break;
            if(tri(L->p,M->p,p)<0) {
                R = M;
            }else if(tri(M->p,R->p,p)<0) {
                L = M;
            }else {
                return;
            }
        }
        while(tri(L->pr[0]->p,L->p,p)<=0) L = L->del()->pr[0];
        while(tri(R->p,R->nx[0]->p,p)<=0) R = R->del();
        L->insert(new ND(p));
    }
}

int main() {
    srand(88213);
    int QQ,qq,tp,tx,ty;
    PT p,p1,p2,p3,C;
    scanf("%d",&QQ);
    scanf("%d %d %d",&tp,&tx,&ty);
    p1 = PT(tx,ty);
    scanf("%d %d %d",&tp,&tx,&ty);
    p2 = PT(tx,ty);
    scanf("%d %d %d",&tp,&tx,&ty);
    p3 = PT(tx,ty);
    if(tri(p1,p2,p3)<0) {
        swap(p2,p3);
    }
    head = new ND(p1,MAXH);
    head->insert(new ND(p3));
    head->insert(new ND(p2));
    for( qq=3; qq<QQ; qq++ ) {
        scanf("%d %d %d",&tp,&tx,&ty);
        p = PT(tx,ty);
        if(tp==1) {
            insert(p);
        }else {
            puts(inside(p)?"YES":"NO");
        }
    }
    return 0;
}


#include <stdio.h>
#include <algorithm>
#include <stdlib.h>

using namespace std;

#define MAXH 14

class PT{
    public:
        long long x,y;
        PT(){}
        PT(long long _x,long long _y) {
            x = _x; y = _y;
        }
        PT operator+(const PT& p) const {
            return PT(x+p.x,y+p.y);
        }
        PT operator-(const PT& p) const {
            return PT(x-p.x,y-p.y);
        }
        long long operator*(const PT& p) const {
            return x*p.x+y*p.y;
        }
        long long operator^(const PT& p) const {
            return x*p.y-y*p.x;
        }
};

class ND{
    public:
        ND* nx[MAXH+1];
        ND* pr[MAXH+1];
        PT p;
        int h;
        ND() {}
        ND(const PT& _p,int _h=0) {
            int x,i;
            if(_h) {
                h = _h;
            }else {
                x = rand()&((1<<MAXH)-1);
                for( h=0; x&(1<<h); h++ );
            }
            p = _p;
            for( i=0; i<=h; i++ ) {
                nx[i] = pr[i] = this;
            }
        }
        void insert(ND* d,int s=0) {
            int i;
            for( i=s; i<=h && i<=d->h; i++ ) {
                d->nx[i] = nx[i];
                d->pr[i] = this;
                nx[i]->pr[i] = d;
                nx[i] = d;
            }
            if(i<=d->h) pr[h]->insert(d,h+1);
        }
        ND* del() {
            int i;
            ND* t;
            t = nx[0];
            for( i=0; i<=h; i++ ) {
                nx[i]->pr[i] = pr[i];
                pr[i]->nx[i] = nx[i];
            }
            delete this;
            return t;
        }
};

ND *head;

inline long long tri(PT p1,PT p2,PT p3) {
    return (p2-p1)^(p3-p1);
}

inline int inside(PT p) {
    ND *L,*R,*M;
    int h;
    L = head;
    R = head->pr[0];
    if(tri(R->p,L->p,p)<0) return 0;
    h = L->h;
    while(L->nx[h]==L) h--;
    while(1) {
        while(h>=0 && (M=L->nx[h])==R) h--;
        if(h<0) break;
        if(tri(L->p,M->p,p)<0) {
            R = M;
        }else if(tri(M->p,R->p,p)<0) {
            L = M;
        }else {
            return 1;
        }
    }
    return 0;
}

inline void insert(PT p) {
    ND *L,*R,*M;
    int h;
    L = head;
    R = head->pr[0];
    if(tri(R->p,L->p,p)<=0) {
        if(tri(R->p,L->p,p)==0 && (R->p-p)*(L->p-p)<=0) return;
        swap(L,R);
        while(tri(L->pr[0]->p,L->p,p)<=0) L = L->del()->pr[0];
        if(tri(R->p,R->nx[0]->p,p)<=0) {
            R = R->nx[0];
            while(tri(R->p,R->nx[0]->p,p)<=0) R = R->del();
            head->p = p;
        }else {
            L->insert(new ND(p));
        }
    }else {
        h = L->h;
        while(L->nx[h]==L) h--;
        while(1) {
            while(h>=0 && (M=L->nx[h])==R) h--;
            if(h<0) break;
            if(tri(L->p,M->p,p)<0) {
                R = M;
            }else if(tri(M->p,R->p,p)<0) {
                L = M;
            }else {
                return;
            }
        }
        while(tri(L->pr[0]->p,L->p,p)<=0) L = L->del()->pr[0];
        while(tri(R->p,R->nx[0]->p,p)<=0) R = R->del();
        L->insert(new ND(p));
    }
}

int main() {
    srand(88213);
    int QQ,qq,tp,tx,ty;
    PT p,p1,p2,p3,C;
    scanf("%d",&QQ);
    scanf("%d %d %d",&tp,&tx,&ty);
    p1 = PT(tx,ty);
    scanf("%d %d %d",&tp,&tx,&ty);
    p2 = PT(tx,ty);
    scanf("%d %d %d",&tp,&tx,&ty);
    p3 = PT(tx,ty);
    if(tri(p1,p2,p3)<0) {
        swap(p2,p3);
    }
    head = new ND(p1,MAXH);
    head->insert(new ND(p3));
    head->insert(new ND(p2));
    for( qq=3; qq<QQ; qq++ ) {
        scanf("%d %d %d",&tp,&tx,&ty);
        p = PT(tx,ty);
        if(tp==1) {
            insert(p);
        }else {
            puts(inside(p)?"YES":"NO");
        }
    }
    return 0;
}


#include <stdio.h>
#include <algorithm>
#include <stdlib.h>

using namespace std;

#define MAXH 16

class PT{
    public:
        long long x,y;
        PT(){}
        PT(long long _x,long long _y) {
            x = _x; y = _y;
        }
        PT operator+(const PT& p) const {
            return PT(x+p.x,y+p.y);
        }
        PT operator-(const PT& p) const {
            return PT(x-p.x,y-p.y);
        }
        long long operator^(const PT& p) const {
            return x*p.y-y*p.x;
        }
};

class ND{
    public:
        ND* nx[MAXH+1];
        ND* pr[MAXH+1];
        PT p;
        int h;
        ND() {}
        ND(const PT& _p,int _h=0) {
            int x,i;
            if(_h) {
                h = _h;
            }else {
                x = rand()&((1<<MAXH)-1);
                for( h=0; x&(1<<h); h++ );
            }
            p = _p;
            for( i=0; i<=h; i++ ) {
                nx[i] = pr[i] = this;
            }
        }
        void insert(ND* d,int s=0) {
            int i;
            for( i=s; i<=h && i<=d->h; i++ ) {
                d->nx[i] = nx[i];
                d->pr[i] = this;
                nx[i]->pr[i] = d;
                nx[i] = d;
            }
            if(i<=d->h) pr[h]->insert(d,h+1);
        }
        ND* del() {
            int i;
            ND* t;
            t = nx[0];
            for( i=0; i<=h; i++ ) {
                nx[i]->pr[i] = pr[i];
                pr[i]->nx[i] = nx[i];
            }
            delete this;
            return t;
        }
        void prt() {
            ND *t;
            t = this;
            do {
                printf("%lld %lld  %d\n",t->p.x,t->p.y,t->h);
                t = t->nx[0];
            }while(t!=nx[h]);
        }
};

ND *head;

inline long long tri(PT p1,PT p2,PT p3) {
    return (p2-p1)^(p3-p1);
}

inline int inside(PT p) {
    ND *L,*R,*M;
    int h;
    L = head;
    R = head->pr[0];
    if(tri(R->p,L->p,p)<0) return 0;
    h = L->h;
    while(L->nx[h]==L) h--;
    while(1) {
        while(h>=0 && (M=L->nx[h])==R) h--;
        if(h<0) break;
        if(tri(L->p,M->p,p)<0) {
            R = M;
        }else if(tri(M->p,R->p,p)<0) {
            L = M;
        }else {
            return 1;
        }
    }
    return 0;
}

inline void insert(PT p) {
    ND *L,*R,*M;
    int h;
    L = head;
    R = head->pr[0];
    if(tri(R->p,L->p,p)<0) {
        swap(L,R);
        while(tri(L->pr[0]->p,L->p,p)<=0) L = L->del()->pr[0];
        if(tri(R->p,R->nx[0]->p,p)<=0) {
            R = R->nx[0];
            while(tri(R->p,R->nx[0]->p,p)<=0) R = R->del();
            head->p = p;
        }else {
            L->insert(new ND(p));
        }
    }else {
        h = L->h;
        while(L->nx[h]==L) h--;
        while(1) {
            while(h>=0 && (M=L->nx[h])==R) h--;
            if(h<0) break;
            if(tri(L->p,M->p,p)<0) {
                R = M;
            }else if(tri(M->p,R->p,p)<0) {
                L = M;
            }else {
                return;
            }
        }
        if(tri(L->p,R->p,p)>=0) while(1);
        while(tri(L->pr[0]->p,L->p,p)<=0) L = L->del()->pr[0];
        while(tri(R->p,R->nx[0]->p,p)<=0) R = R->del();
        L->insert(new ND(p));
    }
}

int main() {
    srand(88213);
    int QQ,qq,tp,tx,ty;
    PT p,p1,p2,p3,C;
    scanf("%d",&QQ);
    scanf("%d %d %d",&tp,&tx,&ty);
    p1 = PT(tx,ty);
    scanf("%d %d %d",&tp,&tx,&ty);
    p2 = PT(tx,ty);
    scanf("%d %d %d",&tp,&tx,&ty);
    p3 = PT(tx,ty);
    if(tri(p1,p2,p3)<0) {
        swap(p2,p3);
    }
    head = new ND(p1,MAXH);
    head->insert(new ND(p3));
    head->insert(new ND(p2));
    for( qq=3; qq<QQ; qq++ ) {
        scanf("%d %d %d",&tp,&tx,&ty);
        p = PT(tx,ty);
        if(tp==1) {
            insert(p);
        }else {
            puts(inside(p)?"YES":"NO");
        }
    }
    return 0;
}


#include <stdio.h>
#include <algorithm>
#include <stdlib.h>

using namespace std;

#define MAXH 17

class PT{
    public:
        long long x,y;
        PT(){}
        PT(long long _x,long long _y) {
            x = _x; y = _y;
        }
        PT operator+(const PT& p) const {
            return PT(x+p.x,y+p.y);
        }
        PT operator-(const PT& p) const {
            return PT(x-p.x,y-p.y);
        }
        long long operator*(const PT& p) const {
            return x*p.x+y*p.y;
        }
        long long operator^(const PT& p) const {
            return x*p.y-y*p.x;
        }
};

class ND{
    public:
        ND* nx[MAXH+1];
        ND* pr[MAXH+1];
        PT p;
        int h;
        ND() {}
        ND(const PT& _p,int _h=0) {
            int x,i;
            if(_h) {
                h = _h;
            }else {
                x = rand()&((1<<MAXH)-1);
                for( h=0; x&(1<<h); h++ );
            }
            p = _p;
            for( i=0; i<=h; i++ ) {
                nx[i] = pr[i] = this;
            }
        }
        void insert(ND* d,int s=0) {
            int i;
            for( i=s; i<=h && i<=d->h; i++ ) {
                d->nx[i] = nx[i];
                d->pr[i] = this;
                nx[i]->pr[i] = d;
                nx[i] = d;
            }
            if(i<=d->h) pr[h]->insert(d,h+1);
        }
        ND* del() {
            int i;
            ND* t;
            t = nx[0];
            for( i=0; i<=h; i++ ) {
                nx[i]->pr[i] = pr[i];
                pr[i]->nx[i] = nx[i];
            }
            delete this;
            return t;
        }
};

ND *head;

inline long long tri(PT p1,PT p2,PT p3) {
    return (p2-p1)^(p3-p1);
}

inline int inside(PT p) {
    ND *L,*R,*M;
    int h;
    L = head;
    R = head->pr[0];
    if(tri(R->p,L->p,p)<0) return 0;
    h = L->h;
    while(L->nx[h]==L) h--;
    while(1) {
        while(h>=0 && (M=L->nx[h])==R) h--;
        if(h<0) break;
        if(tri(L->p,M->p,p)<0) {
            R = M;
        }else if(tri(M->p,R->p,p)<0) {
            L = M;
        }else {
            return 1;
        }
    }
    return 0;
}

inline void insert(PT p) {
    ND *L,*R,*M;
    int h;
    L = head;
    R = head->pr[0];
    if(tri(R->p,L->p,p)<=0) {
        if(tri(R->p,L->p,p)==0 && (R->p-p)*(L->p-p)<=0) return;
        swap(L,R);
        while(tri(L->pr[0]->p,L->p,p)<=0) L = L->del()->pr[0];
        if(tri(R->p,R->nx[0]->p,p)<=0) {
            R = R->nx[0];
            while(tri(R->p,R->nx[0]->p,p)<=0) R = R->del();
            head->p = p;
        }else {
            L->insert(new ND(p));
        }
    }else {
        h = L->h;
        while(L->nx[h]==L) h--;
        while(1) {
            while(h>=0 && (M=L->nx[h])==R) h--;
            if(h<0) break;
            if(tri(L->p,M->p,p)<0) {
                R = M;
            }else if(tri(M->p,R->p,p)<0) {
                L = M;
            }else {
                return;
            }
        }
        while(tri(L->pr[0]->p,L->p,p)<=0) L = L->del()->pr[0];
        while(tri(R->p,R->nx[0]->p,p)<=0) R = R->del();
        L->insert(new ND(p));
    }
}

int main() {
    srand(88213);
    int QQ,qq,tp,tx,ty;
    PT p,p1,p2,p3,C;
    scanf("%d",&QQ);
    scanf("%d %d %d",&tp,&tx,&ty);
    p1 = PT(tx,ty);
    scanf("%d %d %d",&tp,&tx,&ty);
    p2 = PT(tx,ty);
    scanf("%d %d %d",&tp,&tx,&ty);
    p3 = PT(tx,ty);
    if(tri(p1,p2,p3)<0) {
        swap(p2,p3);
    }
    head = new ND(p1,MAXH);
    head->insert(new ND(p3));
    head->insert(new ND(p2));
    for( qq=3; qq<QQ; qq++ ) {
        scanf("%d %d %d",&tp,&tx,&ty);
        p = PT(tx,ty);
        if(tp==1) {
            insert(p);
        }else {
            puts(inside(p)?"YES":"NO");
        }
    }
    return 0;
}


#include <stdio.h>
#include <algorithm>
#include <stdlib.h>

using namespace std;

#define MAXH 16

class PT{
    public:
        long long x,y;
        PT(){}
        PT(long long _x,long long _y) {
            x = _x; y = _y;
        }
        PT operator+(const PT& p) const {
            return PT(x+p.x,y+p.y);
        }
        PT operator-(const PT& p) const {
            return PT(x-p.x,y-p.y);
        }
        long long operator^(const PT& p) const {
            return x*p.y-y*p.x;
        }
};

inline long long tri(PT p1,PT p2,PT p3) {
    return (p2-p1)^(p3-p1);
}

class ND{
    public:
        ND* nx[MAXH+1];
        ND* pr[MAXH+1];
        PT p;
        int h;
        ND() {}
        ND(const PT& _p,int _h=0) {
            int x,i;
            if(_h) {
                h = _h;
            }else {
                x = rand()&((1<<MAXH)-1);
                for( h=0; x&(1<<h); h++ );
            }
            p = _p;
            for( i=0; i<=h; i++ ) {
                nx[i] = pr[i] = this;
            }
        }
        void insert(ND* d,int s=0) {
            int i;
            for( i=s; i<=h && i<=d->h; i++ ) {
                d->nx[i] = nx[i];
                d->pr[i] = this;
                nx[i]->pr[i] = d;
                nx[i] = d;
            }
            if(i<=d->h) pr[h]->insert(d,h+1);
        }
        ND* del() {
            int i;
            ND* t;
            t = nx[0];
            for( i=0; i<=h; i++ ) {
                nx[i]->pr[i] = pr[i];
                pr[i]->nx[i] = nx[i];
            }
            delete this;
            return t;
        }
        void prt() {
            ND *t;
            t = this;
            do {
                printf("%lld %lld  %d\n",t->p.x,t->p.y,t->h);
                t = t->nx[0];
            }while(t!=nx[h]);
        }
        void check() {
            PT p,q,r;
            ND *t;
            t = this;
            p = t->p;
            t = t->nx[0];
            q = t->p;
            do {
                t = t->nx[0];
                r = t->p;
                if(tri(p,q,r)<=0) {
                    while(1);
                }
                p = q;
                q = r;
            }while(t!=this);
        }
};

ND *head;

inline int inside(PT p) {
    ND *L,*R,*M;
    int h;
    L = head;
    R = head->pr[0];
    if(tri(R->p,L->p,p)<0) return 0;
    h = L->h;
    while(L->nx[h]==L) h--;
    while(1) {
        while(h>=0 && (M=L->nx[h])==R) h--;
        if(h<0) break;
        if(tri(L->p,M->p,p)<0) {
            R = M;
        }else if(tri(M->p,R->p,p)<0) {
            L = M;
        }else {
            return 1;
        }
    }
    return 0;
}

inline void insert(PT p) {
    ND *L,*R,*M;
    int h;
    L = head;
    R = head->pr[0];
    if(tri(R->p,L->p,p)<=0) {
        swap(L,R);
        while(tri(L->pr[0]->p,L->p,p)<=0) L = L->del()->pr[0];
        if(tri(R->p,R->nx[0]->p,p)<=0) {
            R = R->nx[0];
            while(tri(R->p,R->nx[0]->p,p)<=0) R = R->del();
            head->p = p;
        }else {
            L->insert(new ND(p));
        }
    }else {
        h = L->h;
        while(L->nx[h]==L) h--;
        while(1) {
            while(h>=0 && (M=L->nx[h])==R) h--;
            if(h<0) break;
            if(tri(L->p,M->p,p)<0) {
                R = M;
            }else if(tri(M->p,R->p,p)<0) {
                L = M;
            }else {
                return;
            }
        }
        while(tri(L->pr[0]->p,L->p,p)<=0) L = L->del()->pr[0];
        while(tri(R->p,R->nx[0]->p,p)<=0) R = R->del();
        L->insert(new ND(p));
    }
}

int main() {
    srand(88213);
    int QQ,qq,tp,tx,ty;
    PT p,p1,p2,p3,C;
    scanf("%d",&QQ);
    scanf("%d %d %d",&tp,&tx,&ty);
    p1 = PT(tx,ty);
    scanf("%d %d %d",&tp,&tx,&ty);
    p2 = PT(tx,ty);
    scanf("%d %d %d",&tp,&tx,&ty);
    p3 = PT(tx,ty);
    if(tri(p1,p2,p3)<0) {
        swap(p2,p3);
    }
    head = new ND(p1,MAXH);
    head->insert(new ND(p3));
    head->insert(new ND(p2));
    int cc = 0;
    for( qq=3; qq<QQ; qq++ ) {
        scanf("%d %d %d",&tp,&tx,&ty);
        p = PT(tx,ty);
        if(tp==1) {
            insert(p);
        }else {
            head->check();
            cc++;
            if(cc==1181) {
                head->check();
            }
            puts(inside(p)?"YES":"NO");
        }
    }
    return 0;
}


#include <stdio.h>
#include <algorithm>
#include <stdlib.h>

using namespace std;

#define MAXH 16

class PT{
    public:
        long long x,y;
        PT(){}
        PT(long long _x,long long _y) {
            x = _x; y = _y;
        }
        PT operator+(const PT& p) const {
            return PT(x+p.x,y+p.y);
        }
        PT operator-(const PT& p) const {
            return PT(x-p.x,y-p.y);
        }
        long long operator^(const PT& p) const {
            return x*p.y-y*p.x;
        }
};

class ND{
    public:
        ND* nx[MAXH+1];
        ND* pr[MAXH+1];
        PT p;
        int h;
        ND() {}
        ND(const PT& _p,int _h=0) {
            int x,i;
            if(_h) {
                h = _h;
            }else {
                x = rand()&((1<<MAXH)-1);
                for( h=0; x&(1<<h); h++ );
            }
            p = _p;
            for( i=0; i<=h; i++ ) {
                nx[i] = pr[i] = this;
            }
        }
        void insert(ND* d,int s=0) {
            int i;
            for( i=s; i<=h && i<=d->h; i++ ) {
                d->nx[i] = nx[i];
                d->pr[i] = this;
                nx[i]->pr[i] = d;
                nx[i] = d;
            }
            if(i<=d->h) pr[h]->insert(d,h+1);
        }
        ND* del() {
            int i;
            ND* t;
            t = nx[0];
            for( i=0; i<=h; i++ ) {
                nx[i]->pr[i] = pr[i];
                pr[i]->nx[i] = nx[i];
            }
            delete this;
            return t;
        }
        void prt() {
            ND *t;
            t = this;
            do {
                printf("%lld %lld  %d\n",t->p.x,t->p.y,t->h);
                t = t->nx[0];
            }while(t!=nx[h]);
        }
};

ND *head;

inline long long tri(PT p1,PT p2,PT p3) {
    return (p2-p1)^(p3-p1);
}

inline int inside(PT p) {
    ND *L,*R,*M;
    int h;
    L = head;
    R = head->pr[0];
    if(tri(R->p,L->p,p)<0) return 0;
    h = L->h;
    while(L->nx[h]==L) {
        h--;
        if(h<0) while(1);
    }
    while(1) {
        while(h>=0 && (M=L->nx[h])==R) h--;
        if(h<0) break;
        if(tri(L->p,M->p,p)<0) {
            R = M;
        }else if(tri(M->p,R->p,p)<0) {
            L = M;
        }else {
            return 1;
        }
    }
    return 0;
}

inline void insert(PT p) {
    ND *L,*R,*M;
    int h;
    L = head;
    R = head->pr[0];
    if(tri(R->p,L->p,p)<0) {
        swap(L,R);
        while(tri(L->pr[0]->p,L->p,p)<=0) L = L->del()->pr[0];
        if(tri(R->p,R->nx[0]->p,p)<=0) {
            R = R->nx[0];
            while(tri(R->p,R->nx[0]->p,p)<=0) R = R->del();
            head->p = p;
        }else {
            L->insert(new ND(p));
        }
    }else {
        h = L->h;
        while(L->nx[h]==L) {
            h--;
            if(h<0) while(1);
        }
        while(1) {
            while(h>=0 && (M=L->nx[h])==R) h--;
            if(h<0) break;
            if(tri(L->p,M->p,p)<0) {
                R = M;
            }else if(tri(M->p,R->p,p)<0) {
                L = M;
            }else {
                return;
            }
        }
        while(tri(L->pr[0]->p,L->p,p)<=0) L = L->del()->pr[0];
        while(tri(R->p,R->nx[0]->p,p)<=0) R = R->del();
        L->insert(new ND(p));
    }
}

int main() {
    srand(88213);
    int QQ,qq,tp,tx,ty;
    PT p,p1,p2,p3,C;
    scanf("%d",&QQ);
    scanf("%d %d %d",&tp,&tx,&ty);
    p1 = PT(tx,ty);
    scanf("%d %d %d",&tp,&tx,&ty);
    p2 = PT(tx,ty);
    scanf("%d %d %d",&tp,&tx,&ty);
    p3 = PT(tx,ty);
    if(tri(p1,p2,p3)<0) {
        swap(p2,p3);
    }
    head = new ND(p1,MAXH);
    head->insert(new ND(p3));
    head->insert(new ND(p2));
    for( qq=3; qq<QQ; qq++ ) {
        scanf("%d %d %d",&tp,&tx,&ty);
        p = PT(tx,ty);
        if(tp==1) {
            insert(p);
        }else {
            puts(inside(p)?"YES":"NO");
        }
    }
    return 0;
}


#include <stdio.h>
#include <string.h>
#include <algorithm>

using namespace std;

class PT{
    public:
        long long x,y;
        bool operator<(const PT& p) const {
            if(x==p.x) return y<p.y;
            return x<p.x;
        }
};

inline long long tri(PT &p1,PT &p2,PT &p3) {
    return (p1.x*p2.y+p2.x*p3.y+p3.x*p1.y)-(p1.y*p2.x+p2.y*p3.x+p3.y*p1.x);
}

PT pt[100010];
PT stk[100010];

int main() {
    int Q,qq,i,j,tp,n,m,d,top,f;
    PT p;
    scanf("%d",&Q);
    n = m = 0;
    for( qq=0; qq<Q; qq++ ) {
        scanf("%d %I64d %I64d",&tp,&p.x,&p.y);
        if(tp==1) {
            pt[n++] = p;
        }else {
            sort(pt+m,pt+n);
            inplace_merge(pt,pt+m,pt+n);
            top = -1;
            for( i=0; i<n; i++ ) {
                while(top>0 && tri(stk[top-1],stk[top],pt[i])<=0) top--;
                stk[++top] = pt[i];
            }
            d = top;
            for( i=n-2; i>=0; i-- ) {
                while(top>d && tri(stk[top-1],stk[top],pt[i])<=0) top--;
                stk[++top] = pt[i];
            }
            m = n = top;
            for( i=0; i<n; i++ ) {
                pt[i] = stk[i];
            }
            pt[n] = pt[0];
            f = 1;
            for( i=1; i<=n; i++ ) {
                if(tri(p,pt[i-1],pt[i])<0) {
                    f = 0;
                    break;
                }
            }
            puts(f?"YES":"NO");
            for( i=d,j=n-1; i<j; i++,j-- ) {
                swap(pt[i],pt[j]);
            }
            inplace_merge(pt,pt+d,pt+n);
        }
    }
    return 0;
}


#include <stdio.h>
#include <algorithm>
#include <stdlib.h>

using namespace std;

#define MAXH 16

class PT{
    public:
        long long x,y;
        PT(){}
        PT(long long _x,long long _y) {
            x = _x; y = _y;
        }
        PT operator+(const PT& p) const {
            return PT(x+p.x,y+p.y);
        }
        PT operator-(const PT& p) const {
            return PT(x-p.x,y-p.y);
        }
        long long operator^(const PT& p) const {
            return x*p.y-y*p.x;
        }
};

class ND{
    public:
        ND* nx[MAXH+1];
        ND* pr[MAXH+1];
        PT p;
        int h;
        ND() {}
        ND(const PT& _p,int _h=0) {
            int x,i;
            if(_h) {
                h = _h;
            }else {
                x = rand()&((1<<MAXH)-1);
                for( h=0; x&(1<<h); h++ );
            }
            p = _p;
            for( i=0; i<=h; i++ ) {
                nx[i] = pr[i] = this;
            }
        }
        void insert(ND* d,int s=0) {
            int i;
            for( i=s; i<=h && i<=d->h; i++ ) {
                d->nx[i] = nx[i];
                d->pr[i] = this;
                nx[i]->pr[i] = d;
                nx[i] = d;
            }
        }
        ND* del() {
            int i;
            ND* t;
            t = nx[0];
            for( i=0; i<=h; i++ ) {
                nx[i]->pr[i] = pr[i];
                pr[i]->nx[i] = nx[i];
            }
            free(this);
            return t;
        }
        void prt() {
            ND *t;
            t = this;
            do {
                printf("%lld %lld  %d\n",t->p.x,t->p.y,t->h);
                t = t->nx[0];
            }while(t!=nx[h]);
        }
};

ND *head;

inline long long tri(PT p1,PT p2,PT p3) {
    return (p2-p1)^(p3-p1);
}

inline int inside(PT p) {
    ND *L,*R,*M;
    int h;
    L = head;
    R = head->pr[0];
    if(tri(R->p,L->p,p)<0) return 0;
    h = L->h;
    while(L->nx[h]==L) h--;
    while(1) {
        while(h>=0 && (M=L->nx[h])==R) h--;
        if(h<0) break;
        if(tri(L->p,M->p,p)<0) {
            R = M;
        }else if(tri(M->p,R->p,p)<0) {
            L = M;
        }else {
            return 1;
        }
    }
    return 0;
}

inline void insert(PT p) {
    ND *L,*R,*M;
    int h;
    L = head;
    R = head->pr[0];
    if(tri(R->p,L->p,p)<0) {
        swap(L,R);
        while(tri(L->pr[0]->p,L->p,p)<=0) L = L->del()->pr[0];
        if(tri(R->p,R->nx[0]->p,p)<=0) {
            R = R->nx[0];
            while(tri(R->p,R->nx[0]->p,p)<=0) R = R->del();
            head->p = p;
        }else {
            L->insert(new ND(p));
        }
    }else {
        h = L->h;
        while(L->nx[h]==L) h--;
        while(1) {
            while(h>=0 && (M=L->nx[h])==R) h--;
            if(h<0) break;
            if(tri(L->p,M->p,p)<0) {
                R = M;
            }else if(tri(M->p,R->p,p)<0) {
                L = M;
            }else {
                return;
            }
        }
        while(tri(L->pr[0]->p,L->p,p)<=0) L = L->del()->pr[0];
        while(tri(R->p,R->nx[0]->p,p)<=0) R = R->del();
        L->insert(new ND(p));
    }
}

int main() {
    srand(88213);
    int QQ,qq,tp,tx,ty;
    PT p,p1,p2,p3,C;
    scanf("%d",&QQ);
    scanf("%d %d %d",&tp,&tx,&ty);
    p1 = PT(tx,ty);
    scanf("%d %d %d",&tp,&tx,&ty);
    p2 = PT(tx,ty);
    scanf("%d %d %d",&tp,&tx,&ty);
    p3 = PT(tx,ty);
    if(tri(p1,p2,p3)<0) {
        swap(p2,p3);
    }
    head = new ND(p1,MAXH);
    head->insert(new ND(p3));
    head->insert(new ND(p2));
    for( qq=3; qq<QQ; qq++ ) {
        scanf("%d %d %d",&tp,&tx,&ty);
        p = PT(tx,ty);
        if(tp==1) {
            insert(p);
        }else {
            puts(inside(p)?"YES":"NO");
        }
    }
    return 0;
}


#include <stdio.h>
#include <string.h>
#include <algorithm>

using namespace std;

class PT{
    public:
        long long x,y;
        bool operator<(const PT& p) const {
            if(x==p.x) return y<p.y;
            return x<p.x;
        }
};

inline long long tri(PT &p1,PT &p2,PT &p3) {
    return (p1.x*p2.y+p2.x*p3.y+p3.x*p1.y)-(p1.y*p2.x+p2.y*p3.x+p3.y*p1.x);
}

PT pt[100010];
PT stk[100010];

int main() {
    int Q,qq,i,tp,n,m,d,top,f;
    PT p;
    scanf("%d",&Q);
    n = m = 0;
    for( qq=0; qq<Q; qq++ ) {
        scanf("%d %I64d %I64d",&tp,&p.x,&p.y);
        if(tp==1) {
            pt[n++] = p;
        }else {
            sort(pt+m,pt+n);
            inplace_merge(pt,pt+m,pt+n);
            stk[0] = pt[0];
            top = 0;
            for( i=1; i<n; i++ ) {
                while(top>0 && tri(stk[top-1],stk[top],pt[i])<=0) top--;
                stk[++top] = pt[i];
            }
            d = top;
            for( i=n-2; i>=0; i-- ) {
                while(top>d && tri(stk[top-1],stk[top],pt[i])<=0) top--;
                stk[++top] = pt[i];
            }
            m = n = top;
            pt[0] = stk[0];
            f = 1;
            for( i=1; i<=n; i++ ) {
                pt[i] = stk[i];
                if(f && tri(p,pt[i-1],pt[i])<0) {
                    f = 0;
                }
            }
            puts(f?"YES":"NO");
        }
    }
    return 0;
}


#include <stdio.h>
#include <algorithm>
#include <stdlib.h>

using namespace std;

#define MAXH 16

class PT{
    public:
        long long x,y;
        PT(){}
        PT(long long _x,long long _y) {
            x = _x; y = _y;
        }
        PT operator+(const PT& p) const {
            return PT(x+p.x,y+p.y);
        }
        PT operator-(const PT& p) const {
            return PT(x-p.x,y-p.y);
        }
        long long operator*(const PT& p) const {
            return x*p.x+y*p.y;
        }
        long long operator^(const PT& p) const {
            return x*p.y-y*p.x;
        }
};

inline long long tri(PT p1,PT p2,PT p3) {
    return (p2-p1)^(p3-p1);
}

class ND{
    public:
        ND* nx[MAXH+1];
        ND* pr[MAXH+1];
        PT p;
        int h;
        ND() {}
        ND(const PT& _p,int _h=0) {
            int x,i;
            if(_h) {
                h = _h;
            }else {
                x = rand()&((1<<MAXH)-1);
                for( h=0; x&(1<<h); h++ );
            }
            p = _p;
            for( i=0; i<=h; i++ ) {
                nx[i] = pr[i] = this;
            }
        }
        void insert(ND* d,int s=0) {
            int i;
            for( i=s; i<=h && i<=d->h; i++ ) {
                d->nx[i] = nx[i];
                d->pr[i] = this;
                nx[i]->pr[i] = d;
                nx[i] = d;
            }
            if(i<=d->h) pr[h]->insert(d,h+1);
        }
        ND* del() {
            int i;
            ND* t;
            t = nx[0];
            for( i=0; i<=h; i++ ) {
                nx[i]->pr[i] = pr[i];
                pr[i]->nx[i] = nx[i];
            }
            delete this;
            return t;
        }
        void prt() {
            ND *t;
            t = this;
            do {
                printf("%lld %lld  %d\n",t->p.x,t->p.y,t->h);
                t = t->nx[0];
            }while(t!=nx[h]);
        }
        void check() {
            PT p,q,r;
            ND *t;
            t = this;
            p = t->p;
            t = t->nx[0];
            q = t->p;
            do {
                t = t->nx[0];
                r = t->p;
                if(tri(p,q,r)<=0) {
                    while(1);
                }
                p = q;
                q = r;
            }while(t!=this);
        }
};

ND *head;

inline int inside(PT p) {
    ND *L,*R,*M;
    int h;
    L = head;
    R = head->pr[0];
    if(tri(R->p,L->p,p)<0) return 0;
    h = L->h;
    while(L->nx[h]==L) h--;
    while(1) {
        while(h>=0 && (M=L->nx[h])==R) h--;
        if(h<0) break;
        if(tri(L->p,M->p,p)<0) {
            R = M;
        }else if(tri(M->p,R->p,p)<0) {
            L = M;
        }else {
            return 1;
        }
    }
    return 0;
}

inline void insert(PT p) {
    ND *L,*R,*M;
    int h;
    L = head;
    R = head->pr[0];
    if(tri(R->p,L->p,p)<=0) {
        if(tri(R->p,L->p,p)==0 && (R->p-p)*(L->p-p)<=0) return;
        swap(L,R);
        while(tri(L->pr[0]->p,L->p,p)<=0) L = L->del()->pr[0];
        if(tri(R->p,R->nx[0]->p,p)<=0) {
            R = R->nx[0];
            while(tri(R->p,R->nx[0]->p,p)<=0) R = R->del();
            head->p = p;
        }else {
            L->insert(new ND(p));
        }
    }else {
        h = L->h;
        while(L->nx[h]==L) h--;
        while(1) {
            while(h>=0 && (M=L->nx[h])==R) h--;
            if(h<0) break;
            if(tri(L->p,M->p,p)<0) {
                R = M;
            }else if(tri(M->p,R->p,p)<0) {
                L = M;
            }else {
                return;
            }
        }
        while(tri(L->pr[0]->p,L->p,p)<=0) L = L->del()->pr[0];
        while(tri(R->p,R->nx[0]->p,p)<=0) R = R->del();
        L->insert(new ND(p));
    }
}

int main() {
    srand(88213);
    int QQ,qq,tp,tx,ty;
    PT p,p1,p2,p3,C;
    scanf("%d",&QQ);
    scanf("%d %d %d",&tp,&tx,&ty);
    p1 = PT(tx,ty);
    scanf("%d %d %d",&tp,&tx,&ty);
    p2 = PT(tx,ty);
    scanf("%d %d %d",&tp,&tx,&ty);
    p3 = PT(tx,ty);
    if(tri(p1,p2,p3)<0) {
        swap(p2,p3);
    }
    head = new ND(p1,MAXH);
    head->insert(new ND(p3));
    head->insert(new ND(p2));
    for( qq=3; qq<QQ; qq++ ) {
        scanf("%d %d %d",&tp,&tx,&ty);
        p = PT(tx,ty);
        if(tp==1) {
            insert(p);
        }else {
            puts(inside(p)?"YES":"NO");
        }
    }
    return 0;
}


#include <stdio.h>
#include <algorithm>
#include <stdlib.h>

using namespace std;

#define MAXH 16

class PT{
    public:
        long long x,y;
        PT(){}
        PT(long long _x,long long _y) {
            x = _x; y = _y;
        }
        PT operator+(const PT& p) const {
            return PT(x+p.x,y+p.y);
        }
        PT operator-(const PT& p) const {
            return PT(x-p.x,y-p.y);
        }
        long long operator^(const PT& p) const {
            return x*p.y-y*p.x;
        }
};

inline long long tri(PT p1,PT p2,PT p3) {
    return (p2-p1)^(p3-p1);
}

class ND{
    public:
        ND* nx[MAXH+1];
        ND* pr[MAXH+1];
        PT p;
        int h;
        ND() {}
        ND(const PT& _p,int _h=0) {
            int x,i;
            if(_h) {
                h = _h;
            }else {
                x = rand()&((1<<MAXH)-1);
                for( h=0; x&(1<<h); h++ );
            }
            p = _p;
            for( i=0; i<=h; i++ ) {
                nx[i] = pr[i] = this;
            }
        }
        void insert(ND* d,int s=0) {
            int i;
            for( i=s; i<=h && i<=d->h; i++ ) {
                d->nx[i] = nx[i];
                d->pr[i] = this;
                nx[i]->pr[i] = d;
                nx[i] = d;
            }
            if(i<=d->h) pr[h]->insert(d,h+1);
        }
        ND* del() {
            int i;
            ND* t;
            t = nx[0];
            for( i=0; i<=h; i++ ) {
                nx[i]->pr[i] = pr[i];
                pr[i]->nx[i] = nx[i];
            }
            delete this;
            return t;
        }
        void prt() {
            ND *t;
            t = this;
            do {
                printf("%lld %lld  %d\n",t->p.x,t->p.y,t->h);
                t = t->nx[0];
            }while(t!=nx[h]);
        }
        void check() {
            PT p,q,r;
            ND *t;
            t = this;
            p = t->p;
            t = t->nx[0];
            q = t->p;
            do {
                t = t->nx[0];
                r = t->p;
                if(tri(p,q,r)<=0) {
                    while(1);
                }
                p = q;
                q = r;
            }while(t!=this);
        }
};

ND *head;

inline int inside(PT p) {
    ND *L,*R,*M;
    int h;
    L = head;
    R = head->pr[0];
    if(tri(R->p,L->p,p)<0) return 0;
    h = L->h;
    while(L->nx[h]==L) h--;
    while(1) {
        while(h>=0 && (M=L->nx[h])==R) h--;
        if(h<0) break;
        if(tri(L->p,M->p,p)<0) {
            R = M;
        }else if(tri(M->p,R->p,p)<0) {
            L = M;
        }else {
            return 1;
        }
    }
    return 0;
}

inline void insert(PT p) {
    ND *L,*R,*M;
    int h;
    L = head;
    R = head->pr[0];
    if(tri(R->p,L->p,p)<=0) {
        swap(L,R);
        while(tri(L->pr[0]->p,L->p,p)<=0) L = L->del()->pr[0];
        if(tri(R->p,R->nx[0]->p,p)<=0) {
            R = R->nx[0];
            while(tri(R->p,R->nx[0]->p,p)<=0) R = R->del();
            head->p = p;
        }else {
            L->insert(new ND(p));
        }
    }else {
        h = L->h;
        while(L->nx[h]==L) h--;
        while(1) {
            while(h>=0 && (M=L->nx[h])==R) h--;
            if(h<0) break;
            if(tri(L->p,M->p,p)<0) {
                R = M;
            }else if(tri(M->p,R->p,p)<0) {
                L = M;
            }else {
                return;
            }
        }
        while(tri(L->pr[0]->p,L->p,p)<=0) L = L->del()->pr[0];
        while(tri(R->p,R->nx[0]->p,p)<=0) R = R->del();
        L->insert(new ND(p));
    }
}

int main() {
    srand(88213);
    int QQ,qq,tp,tx,ty;
    PT p,p1,p2,p3,C;
    scanf("%d",&QQ);
    scanf("%d %d %d",&tp,&tx,&ty);
    p1 = PT(tx,ty);
    scanf("%d %d %d",&tp,&tx,&ty);
    p2 = PT(tx,ty);
    scanf("%d %d %d",&tp,&tx,&ty);
    p3 = PT(tx,ty);
    if(tri(p1,p2,p3)<0) {
        swap(p2,p3);
    }
    head = new ND(p1,MAXH);
    head->insert(new ND(p3));
    head->insert(new ND(p2));
    int cc = 0;
    for( qq=3; qq<QQ; qq++ ) {
        scanf("%d %d %d",&tp,&tx,&ty);
        p = PT(tx,ty);
        if(tp==1) {
            insert(p);
        }else {
            cc++;
            if(cc==1181) {
                head->check();
            }
            puts(inside(p)?"YES":"NO");
        }
    }
    return 0;
}


#include <stdio.h>
#include <algorithm>
#include <stdlib.h>

using namespace std;

#define MAXH 16

class PT{
    public:
        long long x,y;
        PT(){}
        PT(long long _x,long long _y) {
            x = _x; y = _y;
        }
        PT operator+(const PT& p) const {
            return PT(x+p.x,y+p.y);
        }
        PT operator-(const PT& p) const {
            return PT(x-p.x,y-p.y);
        }
        long long operator^(const PT& p) const {
            return x*p.y-y*p.x;
        }
};

class ND{
    public:
        ND* nx[MAXH+1];
        ND* pr[MAXH+1];
        PT p;
        int h;
        ND() {}
        ND(const PT& _p,int _h=0) {
            int x,i;
            if(_h) {
                h = _h;
            }else {
                x = rand()&((1<<MAXH)-1);
                for( h=0; x&(1<<h); h++ );
            }
            p = _p;
            for( i=0; i<=h; i++ ) {
                nx[i] = pr[i] = this;
            }
        }
        void insert(ND* d,int s=0) {
            int i;
            for( i=s; i<=h && i<=d->h; i++ ) {
                d->nx[i] = nx[i];
                d->pr[i] = this;
                nx[i]->pr[i] = d;
                nx[i] = d;
            }
            if(i<=d->h) pr[h]->insert(d,h+1);
        }
        ND* del() {
            int i;
            ND* t;
            t = nx[0];
            for( i=0; i<=h; i++ ) {
                nx[i]->pr[i] = pr[i];
                pr[i]->nx[i] = nx[i];
            }
            delete this;
            return t;
        }
        void prt() {
            ND *t;
            t = this;
            do {
                printf("%lld %lld  %d\n",t->p.x,t->p.y,t->h);
                t = t->nx[0];
            }while(t!=nx[h]);
        }
};

ND *head;

inline long long tri(PT p1,PT p2,PT p3) {
    return (p2-p1)^(p3-p1);
}

inline int inside(PT p) {
    ND *L,*R,*M;
    int h;
    L = head;
    R = head->pr[0];
    if(tri(R->p,L->p,p)<0) return 0;
    h = L->h;
    while(L->nx[h]==L) h--;
    while(1) {
        while(h>=0 && (M=L->nx[h])==R) h--;
        if(h<0) break;
        if(tri(L->p,M->p,p)<0) {
            R = M;
        }else if(tri(M->p,R->p,p)<0) {
            L = M;
        }else {
            return 1;
        }
    }
    return 0;
}

inline void insert(PT p) {
    ND *L,*R,*M;
    int h;
    L = head;
    R = head->pr[0];
    if(tri(R->p,L->p,p)<=0) {
        swap(L,R);
        while(tri(L->pr[0]->p,L->p,p)<=0) L = L->del()->pr[0];
        if(tri(R->p,R->nx[0]->p,p)<=0) {
            R = R->nx[0];
            while(tri(R->p,R->nx[0]->p,p)<=0) R = R->del();
            head->p = p;
        }else {
            L->insert(new ND(p));
        }
    }else {
        h = L->h;
        while(L->nx[h]==L) h--;
        while(1) {
            while(h>=0 && (M=L->nx[h])==R) h--;
            if(h<0) break;
            if(tri(L->p,M->p,p)<0) {
                R = M;
            }else if(tri(M->p,R->p,p)<0) {
                L = M;
            }else {
                return;
            }
        }
        while(tri(L->pr[0]->p,L->p,p)<=0) L = L->del()->pr[0];
        while(tri(R->p,R->nx[0]->p,p)<=0) R = R->del();
        L->insert(new ND(p));
    }
}

int main() {
    srand(88213);
    int QQ,qq,tp,tx,ty;
    PT p,p1,p2,p3,C;
    scanf("%d",&QQ);
    scanf("%d %d %d",&tp,&tx,&ty);
    p1 = PT(tx,ty);
    scanf("%d %d %d",&tp,&tx,&ty);
    p2 = PT(tx,ty);
    scanf("%d %d %d",&tp,&tx,&ty);
    p3 = PT(tx,ty);
    if(tri(p1,p2,p3)<0) {
        swap(p2,p3);
    }
    head = new ND(p1,MAXH);
    head->insert(new ND(p3));
    head->insert(new ND(p2));
    for( qq=3; qq<QQ; qq++ ) {
        scanf("%d %d %d",&tp,&tx,&ty);
        p = PT(tx,ty);
        if(tp==1) {
            insert(p);
        }else {
            puts(inside(p)?"YES":"NO");
        }
    }
    return 0;
}


#include <stdio.h>
#include <algorithm>
#include <stdlib.h>

using namespace std;

#define MAXH 16

class PT{
    public:
        long long x,y;
        PT(){}
        PT(long long _x,long long _y) {
            x = _x; y = _y;
        }
        PT operator+(const PT& p) const {
            return PT(x+p.x,y+p.y);
        }
        PT operator-(const PT& p) const {
            return PT(x-p.x,y-p.y);
        }
        long long operator^(const PT& p) const {
            return x*p.y-y*p.x;
        }
};

class ND{
    public:
        ND* nx[MAXH+1];
        ND* pr[MAXH+1];
        PT p;
        int h;
        ND() {}
        ND(const PT& _p,int _h=0) {
            int x,i;
            if(_h) {
                h = _h;
            }else {
                x = rand()&((1<<MAXH)-1);
                for( h=0; x&(1<<h); h++ );
            }
            p = _p;
            for( i=0; i<=h; i++ ) {
                nx[i] = pr[i] = this;
            }
        }
        void insert(ND* d,int s=0) {
            int i;
            for( i=s; i<=h && i<=d->h; i++ ) {
                d->nx[i] = nx[i];
                d->pr[i] = this;
                nx[i]->pr[i] = d;
                nx[i] = d;
            }
            if(i<=d->h) pr[h]->insert(d,h+1);
        }
        ND* del() {
            int i;
            ND* t;
            t = nx[0];
            for( i=0; i<=h; i++ ) {
                nx[i]->pr[i] = pr[i];
                pr[i]->nx[i] = nx[i];
            }
            delete this;
            return t;
        }
        void prt() {
            ND *t;
            t = this;
            do {
                printf("%lld %lld  %d\n",t->p.x,t->p.y,t->h);
                t = t->nx[0];
            }while(t!=nx[h]);
        }
};

ND *head;

inline long long tri(PT p1,PT p2,PT p3) {
    return (p2-p1)^(p3-p1);
}

inline int inside(PT p) {
    ND *L,*R,*M;
    int h;
    L = head;
    R = head->pr[0];
    if(tri(R->p,L->p,p)<0) return 0;
    h = L->h;
    while(L->nx[h]==L) h--;
    while(1) {
        while(h>=0 && (M=L->nx[h])==R) h--;
        if(h<0) break;
        if(tri(L->p,M->p,p)<0) {
            R = M;
        }else if(tri(M->p,R->p,p)<0) {
            L = M;
        }else {
            return 1;
        }
    }
    return 0;
}

inline void insert(PT p) {
    ND *L,*R,*M;
    int h;
    L = head;
    R = head->pr[0];
    if(tri(R->p,L->p,p)<0) {
        swap(L,R);
        while(tri(L->pr[0]->p,L->p,p)<=0) L = L->del()->pr[0];
        if(tri(R->p,R->nx[0]->p,p)<=0) {
            R = R->nx[0];
            while(tri(R->p,R->nx[0]->p,p)<=0) R = R->del();
            head->p = p;
        }else {
            L->insert(new ND(p));
        }
    }else {
        h = L->h;
        while(L->nx[h]==L) h--;
        while(1) {
            while(h>=0 && (M=L->nx[h])==R) h--;
            if(h<0) break;
            if(tri(L->p,M->p,p)<0) {
                R = M;
            }else if(tri(M->p,R->p,p)<0) {
                L = M;
            }else {
                return;
            }
        }
        while(tri(L->pr[0]->p,L->p,p)<=0) L = L->del()->pr[0];
        while(tri(R->p,R->nx[0]->p,p)<=0) R = R->del();
        L->insert(new ND(p));
    }
}

int main() {
    srand(88213);
    int QQ,qq,tp,tx,ty;
    PT p,p1,p2,p3,C;
    scanf("%d",&QQ);
    scanf("%d %d %d",&tp,&tx,&ty);
    p1 = PT(tx,ty);
    scanf("%d %d %d",&tp,&tx,&ty);
    p2 = PT(tx,ty);
    scanf("%d %d %d",&tp,&tx,&ty);
    p3 = PT(tx,ty);
    if(tri(p1,p2,p3)<0) {
        swap(p2,p3);
    }
    head = new ND(p1,MAXH);
    head->insert(new ND(p3));
    head->insert(new ND(p2));
    for( qq=3; qq<QQ; qq++ ) {
        scanf("%d %d %d",&tp,&tx,&ty);
        p = PT(tx,ty);
        if(tp==1) {
            insert(p);
        }else {
            puts(inside(p)?"YES":"NO");
        }
    }
    return 0;
}


#include <stdio.h>
#include <algorithm>
#include <stdlib.h>

using namespace std;

#define MAXH 16

class PT{
    public:
        long long x,y;
        PT(){}
        PT(long long _x,long long _y) {
            x = _x; y = _y;
        }
        PT operator+(const PT& p) const {
            return PT(x+p.x,y+p.y);
        }
        PT operator-(const PT& p) const {
            return PT(x-p.x,y-p.y);
        }
        long long operator^(const PT& p) const {
            return x*p.y-y*p.x;
        }
};

class ND{
    public:
        ND* nx[MAXH+1];
        ND* pr[MAXH+1];
        PT p;
        int h;
        ND() {}
        ND(const PT& _p,int _h=0) {
            int x,i;
            if(_h) {
                h = _h;
            }else {
                x = rand()&((1<<MAXH)-1);
                for( h=0; x&(1<<h); h++ );
            }
            p = _p;
            for( i=0; i<=h; i++ ) {
                nx[i] = pr[i] = this;
            }
        }
        void insert(ND* d,int s=0) {
            int i;
            for( i=s; i<=h && i<=d->h; i++ ) {
                d->nx[i] = nx[i];
                d->pr[i] = this;
                nx[i]->pr[i] = d;
                nx[i] = d;
            }
        }
        ND* del() {
            int i;
            ND* t;
            t = nx[0];
            for( i=0; i<=h; i++ ) {
                nx[i]->pr[i] = pr[i];
                pr[i]->nx[i] = nx[i];
            }
            //free(this);
            return t;
        }
        void prt() {
            ND *t;
            t = this;
            do {
                printf("%lld %lld  %d\n",t->p.x,t->p.y,t->h);
                t = t->nx[0];
            }while(t!=nx[h]);
        }
};

ND mem[200100];
int mp;
ND *head;

inline long long tri(PT p1,PT p2,PT p3) {
    return (p2-p1)^(p3-p1);
}

inline int inside(PT p) {
    ND *L,*R,*M;
    int h;
    L = head;
    R = head->pr[0];
    if(tri(R->p,L->p,p)<0) return 0;
    h = L->h;
    while(L->nx[h]==L) h--;
    while(1) {
        while(h>=0 && (M=L->nx[h])==R) h--;
        if(h<0) break;
        if(tri(L->p,M->p,p)<0) {
            R = M;
        }else if(tri(M->p,R->p,p)<0) {
            L = M;
        }else {
            return 1;
        }
    }
    return 0;
}

inline void insert(PT p) {
    ND *L,*R,*M;
    int h;
    L = head;
    R = head->pr[0];
    if(tri(R->p,L->p,p)<0) {
        swap(L,R);
        while(tri(L->pr[0]->p,L->p,p)<=0) L = L->del()->pr[0];
        if(tri(R->p,R->nx[0]->p,p)<=0) {
            R = R->nx[0];
            while(tri(R->p,R->nx[0]->p,p)<=0) R = R->del();
            head->p = p;
        }else {
            mem[++mp] = ND(p);
            L->insert(mem+mp);
        }
    }else {
        h = L->h;
        while(L->nx[h]==L) h--;
        while(1) {
            while(h>=0 && (M=L->nx[h])==R) h--;
            if(h<0) break;
            if(tri(L->p,M->p,p)<0) {
                R = M;
            }else if(tri(M->p,R->p,p)<0) {
                L = M;
            }else {
                return;
            }
        }
        while(tri(L->pr[0]->p,L->p,p)<=0) L = L->del()->pr[0];
        while(tri(R->p,R->nx[0]->p,p)<=0) R = R->del();
        mem[++mp] = ND(p);
        L->insert(mem+mp);
    }
}

int main() {
    srand(88213);
    int QQ,qq,tp,tx,ty;
    PT p,p1,p2,p3,C;
    scanf("%d",&QQ);
    scanf("%d %d %d",&tp,&tx,&ty);
    p1 = PT(tx,ty);
    scanf("%d %d %d",&tp,&tx,&ty);
    p2 = PT(tx,ty);
    scanf("%d %d %d",&tp,&tx,&ty);
    p3 = PT(tx,ty);
    if(tri(p1,p2,p3)<0) {
        swap(p2,p3);
    }
    mp = 0;
    mem[++mp] = ND(p1,MAXH);
    head = mem+mp;
    mem[++mp] = ND(p3);
    head->insert(mem+mp);
    mem[++mp] = ND(p2);
    head->insert(mem+mp);
    for( qq=3; qq<QQ; qq++ ) {
        scanf("%d %d %d",&tp,&tx,&ty);
        p = PT(tx,ty);
        if(tp==1) {
            insert(p);
        }else {
            puts(inside(p)?"YES":"NO");
        }
    }
    return 0;
}


#include <stdio.h>
#include <string.h>
#include <algorithm>

using namespace std;

class PT{
    public:
        long long x,y;
        bool operator<(const PT& p) const {
            if(x==p.x) return y<p.y;
            return x<p.x;
        }
};

inline long long tri(PT &p1,PT &p2,PT &p3) {
    return (p1.x*p2.y+p2.x*p3.y+p3.x*p1.y)-(p1.y*p2.x+p2.y*p3.x+p3.y*p1.x);
}

PT pt[100010];
PT stk[100010];

int main() {
    int Q,qq,i,tp,n,m,d,top,f,x,y;
    PT p;
    scanf("%d",&Q);
    n = m = 0;
    for( qq=0; qq<Q; qq++ ) {
        scanf("%d %d %d",&tp,&x,&y);
        p.x = x;
        p.y = y;
        if(tp==1) {
            pt[n++] = p;
        }else {
            sort(pt+m,pt+n);
            inplace_merge(pt,pt+m,pt+n);
            top = -1;
            for( i=0; i<n; i++ ) {
                while(top>0 && tri(stk[top-1],stk[top],pt[i])<=0) top--;
                stk[++top] = pt[i];
            }
            d = top;
            for( i=n-2; i>=0; i-- ) {
                while(top>d && tri(stk[top-1],stk[top],pt[i])<=0) top--;
                stk[++top] = pt[i];
            }
            m = n = top;
            pt[0] = stk[0];
            f = 1;
            for( i=1; i<=n; i++ ) {
                pt[i] = stk[i];
                if(f && tri(p,pt[i-1],pt[i])<0) {
                    f = 0;
                }
            }
            puts(f?"YES":"NO");
        }
    }
    return 0;
}


#include <stdio.h>
#include <algorithm>
#include <stdlib.h>

using namespace std;

#define MAXH 16

class PT{
    public:
        long long x,y;
        PT(){}
        PT(long long _x,long long _y) {
            x = _x; y = _y;
        }
        PT operator+(const PT& p) const {
            return PT(x+p.x,y+p.y);
        }
        PT operator-(const PT& p) const {
            return PT(x-p.x,y-p.y);
        }
        long long operator^(const PT& p) const {
            return x*p.y-y*p.x;
        }
};

class ND{
    public:
        ND* nx[MAXH+1];
        ND* pr[MAXH+1];
        PT p;
        int h;
        ND() {}
        ND(const PT& _p,int _h=0) {
            int x,i;
            if(_h) {
                h = _h;
            }else {
                x = rand()&((1<<MAXH)-1);
                for( h=0; x&(1<<h); h++ );
            }
            p = _p;
            for( i=0; i<=h; i++ ) {
                nx[i] = pr[i] = this;
            }
        }
        void insert(ND* d,int s=0) {
            int i;
            for( i=s; i<=h && i<=d->h; i++ ) {
                d->nx[i] = nx[i];
                d->pr[i] = this;
                nx[i]->pr[i] = d;
                nx[i] = d;
            }
            if(i<=d->h) pr[h]->insert(d,h+1);
        }
        ND* del() {
            int i;
            ND* t;
            t = nx[0];
            for( i=0; i<=h; i++ ) {
                nx[i]->pr[i] = pr[i];
                pr[i]->nx[i] = nx[i];
            }
            delete this;
            return t;
        }
        void prt() {
            ND *t;
            t = this;
            do {
                printf("%lld %lld  %d\n",t->p.x,t->p.y,t->h);
                t = t->nx[0];
            }while(t!=nx[h]);
        }
};

ND *head;

inline long long tri(PT p1,PT p2,PT p3) {
    return (p2-p1)^(p3-p1);
}

inline int inside(PT p) {
    ND *L,*R,*M;
    int h;
    L = head;
    R = head->pr[0];
    if(tri(R->p,L->p,p)<0) return 0;
    h = L->h;
    while(L->nx[h]==L) h--;
    while(1) {
        while(h>=0 && (M=L->nx[h])==R) h--;
        if(h<0) break;
        if(M==L) while(1);
        if(tri(L->p,M->p,p)<0) {
            R = M;
        }else if(tri(M->p,R->p,p)<0) {
            L = M;
        }else {
            return 1;
        }
    }
    return 0;
}

inline void insert(PT p) {
    ND *L,*R,*M;
    int h;
    L = head;
    R = head->pr[0];
    if(tri(R->p,L->p,p)<=0) {
        swap(L,R);
        while(tri(L->pr[0]->p,L->p,p)<=0) L = L->del()->pr[0];
        if(tri(R->p,R->nx[0]->p,p)<=0) {
            R = R->nx[0];
            while(tri(R->p,R->nx[0]->p,p)<=0) R = R->del();
            head->p = p;
        }else {
            L->insert(new ND(p));
        }
    }else {
        h = L->h;
        while(L->nx[h]==L) h--;
        while(1) {
            while(h>=0 && (M=L->nx[h])==R) h--;
            if(h<0) break;
            if(tri(L->p,M->p,p)<0) {
                R = M;
            }else if(tri(M->p,R->p,p)<0) {
                L = M;
            }else {
                return;
            }
        }
        while(tri(L->pr[0]->p,L->p,p)<=0) L = L->del()->pr[0];
        while(tri(R->p,R->nx[0]->p,p)<=0) R = R->del();
        L->insert(new ND(p));
    }
}

int main() {
    srand(88213);
    int QQ,qq,tp,tx,ty;
    PT p,p1,p2,p3,C;
    scanf("%d",&QQ);
    scanf("%d %d %d",&tp,&tx,&ty);
    p1 = PT(tx,ty);
    scanf("%d %d %d",&tp,&tx,&ty);
    p2 = PT(tx,ty);
    scanf("%d %d %d",&tp,&tx,&ty);
    p3 = PT(tx,ty);
    if(tri(p1,p2,p3)<0) {
        swap(p2,p3);
    }
    head = new ND(p1,MAXH);
    head->insert(new ND(p3));
    head->insert(new ND(p2));
    for( qq=3; qq<QQ; qq++ ) {
        scanf("%d %d %d",&tp,&tx,&ty);
        p = PT(tx,ty);
        if(tp==1) {
            insert(p);
        }else {
            puts(inside(p)?"YES":"NO");
        }
    }
    return 0;
}


#include <stdio.h>
#include <algorithm>
#include <stdlib.h>

using namespace std;

#define MAXH 16

class PT{
    public:
        long long x,y;
        PT(){}
        PT(long long _x,long long _y) {
            x = _x; y = _y;
        }
        PT operator+(const PT& p) const {
            return PT(x+p.x,y+p.y);
        }
        PT operator-(const PT& p) const {
            return PT(x-p.x,y-p.y);
        }
        long long operator^(const PT& p) const {
            return x*p.y-y*p.x;
        }
};

inline long long tri(PT p1,PT p2,PT p3) {
    return (p2-p1)^(p3-p1);
}

class ND{
    public:
        ND* nx[MAXH+1];
        ND* pr[MAXH+1];
        PT p;
        int h;
        ND() {}
        ND(const PT& _p,int _h=0) {
            int x,i;
            if(_h) {
                h = _h;
            }else {
                x = rand()&((1<<MAXH)-1);
                for( h=0; x&(1<<h); h++ );
            }
            p = _p;
            for( i=0; i<=h; i++ ) {
                nx[i] = pr[i] = this;
            }
        }
        void insert(ND* d,int s=0) {
            int i;
            for( i=s; i<=h && i<=d->h; i++ ) {
                d->nx[i] = nx[i];
                d->pr[i] = this;
                nx[i]->pr[i] = d;
                nx[i] = d;
            }
            if(i<=d->h) pr[h]->insert(d,h+1);
        }
        ND* del() {
            int i;
            ND* t;
            t = nx[0];
            for( i=0; i<=h; i++ ) {
                nx[i]->pr[i] = pr[i];
                pr[i]->nx[i] = nx[i];
            }
            delete this;
            return t;
        }
        void prt() {
            ND *t;
            t = this;
            do {
                printf("%lld %lld  %d\n",t->p.x,t->p.y,t->h);
                t = t->nx[0];
            }while(t!=nx[h]);
        }
        void check() {
            PT p,q,r;
            ND *t;
            t = this;
            p = t->p;
            t = t->nx[0];
            q = t->p;
            do {
                t = t->nx[0];
                r = t->p;
                if(tri(p,q,r)<=0) {
                    while(1);
                }
                p = q;
                q = r;
            }while(t!=this);
        }
};

ND *head;

inline int inside(PT p) {
    ND *L,*R,*M;
    int h;
    L = head;
    R = head->pr[0];
    if(tri(R->p,L->p,p)<0) return 0;
    h = L->h;
    while(L->nx[h]==L) h--;
    while(1) {
        while(h>=0 && (M=L->nx[h])==R) h--;
        if(h<0) break;
        if(tri(L->p,M->p,p)<0) {
            R = M;
        }else if(tri(M->p,R->p,p)<0) {
            L = M;
        }else {
            return 1;
        }
    }
    return 0;
}

inline void insert(PT p) {
    ND *L,*R,*M;
    int h;
    L = head;
    R = head->pr[0];
    if(tri(R->p,L->p,p)<=0) {
        swap(L,R);
        while(tri(L->pr[0]->p,L->p,p)<=0) L = L->del()->pr[0];
        if(tri(R->p,R->nx[0]->p,p)<=0) {
            R = R->nx[0];
            while(tri(R->p,R->nx[0]->p,p)<=0) R = R->del();
            head->p = p;
        }else {
            L->insert(new ND(p));
        }
    }else {
        h = L->h;
        while(L->nx[h]==L) h--;
        while(1) {
            while(h>=0 && (M=L->nx[h])==R) h--;
            if(h<0) break;
            if(tri(L->p,M->p,p)<0) {
                R = M;
            }else if(tri(M->p,R->p,p)<0) {
                L = M;
            }else {
                return;
            }
        }
        while(tri(L->pr[0]->p,L->p,p)<=0) L = L->del()->pr[0];
        while(tri(R->p,R->nx[0]->p,p)<=0) R = R->del();
        L->insert(new ND(p));
    }
}

int main() {
    srand(88213);
    int QQ,qq,tp,tx,ty;
    PT p,p1,p2,p3,C;
    scanf("%d",&QQ);
    scanf("%d %d %d",&tp,&tx,&ty);
    p1 = PT(tx,ty);
    scanf("%d %d %d",&tp,&tx,&ty);
    p2 = PT(tx,ty);
    scanf("%d %d %d",&tp,&tx,&ty);
    p3 = PT(tx,ty);
    if(tri(p1,p2,p3)<0) {
        swap(p2,p3);
    }
    head = new ND(p1,MAXH);
    head->insert(new ND(p3));
    head->insert(new ND(p2));
    int cc = 0;
    for( qq=3; qq<QQ; qq++ ) {
        scanf("%d %d %d",&tp,&tx,&ty);
        p = PT(tx,ty);
        if(tp==1) {
            insert(p);
        }else {
            cc++;
            if(cc==1180) {
                head->check();
            }
            puts(inside(p)?"YES":"NO");
        }
    }
    return 0;
}


#include <stdio.h>
#include <string.h>
#include <algorithm>

using namespace std;

class PT{
    public:
        long long x,y;
        bool operator<(const PT& p) const {
            if(x==p.x) return y<p.y;
            return x<p.x;
        }
};

inline long long tri(PT &p1,PT &p2,PT &p3) {
    return (p1.x*p2.y+p2.x*p3.y+p3.x*p1.y)-(p1.y*p2.x+p2.y*p3.x+p3.y*p1.x);
}

PT pt[100010];
PT stk[100010];

int main() {
    int Q,qq,i,tp,n,m,d,top,f,x,y;
    PT p;
    scanf("%d",&Q);
    n = m = 0;
    for( qq=0; qq<Q; qq++ ) {
        scanf("%d %d %d",&tp,&x,&y);
        p.x = x;
        p.y = y;
        if(tp==1) {
            pt[n++] = p;
        }else {
            if(m==n) {
                f = 1;
                for( i=1; i<=n; i++ ) {
                    if(f && tri(p,pt[i-1],pt[i])<0) {
                        f = 0;
                    }
                }
                puts(f?"YES":"NO");
                continue;
            }
            sort(pt+m,pt+n);
            inplace_merge(pt,pt+m,pt+n);
            top = -1;
            for( i=0; i<n; i++ ) {
                while(top>0 && tri(stk[top-1],stk[top],pt[i])<=0) top--;
                stk[++top] = pt[i];
            }
            d = top;
            for( i=n-2; i>=0; i-- ) {
                while(top>d && tri(stk[top-1],stk[top],pt[i])<=0) top--;
                stk[++top] = pt[i];
            }
            m = n = top;
            pt[0] = stk[0];
            f = 1;
            for( i=1; i<=n; i++ ) {
                pt[i] = stk[i];
                if(f && tri(p,pt[i-1],pt[i])<0) {
                    f = 0;
                }
            }
            puts(f?"YES":"NO");
        }
    }
    return 0;
}


#include <stdio.h>
#include <string.h>
#include <algorithm>

using namespace std;

class PT{
    public:
        long long x,y;
        bool operator<(const PT& p) const {
            if(x==p.x) return y<p.y;
            return x<p.x;
        }
};

inline long long tri(PT &p1,PT &p2,PT &p3) {
    return (p1.x*p2.y+p2.x*p3.y+p3.x*p1.y)-(p1.y*p2.x+p2.y*p3.x+p3.y*p1.x);
}

PT pt[100010];
PT stk[100010];

int main() {
    int Q,qq,i,tp,n,m,d,top,f,x,y;
    PT p;
    scanf("%d",&Q);
    n = m = 0;
    for( qq=0; qq<Q; qq++ ) {
        scanf("%d %d %d",&tp,&x,&y);
        p.x = x;
        p.y = y;
        if(tp==1) {
            pt[n++] = p;
        }else {
            if(m==n) {
                f = 1;
                pt[n] = pt[0];
                for( i=1; i<=n; i++ ) {
                    if(tri(p,pt[i-1],pt[i])<0) {
                        f = 0;
                        break;
                    }
                }
                puts(f?"YES":"NO");
                continue;
            }
            sort(pt+m,pt+n);
            inplace_merge(pt,pt+m,pt+n);
            top = -1;
            for( i=0; i<n; i++ ) {
                while(top>0 && tri(stk[top-1],stk[top],pt[i])<=0) top--;
                stk[++top] = pt[i];
            }
            d = top;
            for( i=n-2; i>=0; i-- ) {
                while(top>d && tri(stk[top-1],stk[top],pt[i])<=0) top--;
                stk[++top] = pt[i];
            }
            m = n = top;
            for( i=0; i<n; i++ ) {
                pt[i] = stk[i];
            }
            pt[n] = pt[0];
            f = 1;
            for( i=1; i<=n; i++ ) {
                if(tri(p,pt[i-1],pt[i])<0) {
                    f = 0;
                    break;
                }
            }
            puts(f?"YES":"NO");
        }
    }
    return 0;
}


#include <stdio.h>
#include <algorithm>
#include <stdlib.h>

using namespace std;

#define MAXH 10

class PT{
    public:
        long long x,y;
        PT(){}
        PT(long long _x,long long _y) {
            x = _x; y = _y;
        }
        PT operator+(const PT& p) const {
            return PT(x+p.x,y+p.y);
        }
        PT operator-(const PT& p) const {
            return PT(x-p.x,y-p.y);
        }
        long long operator*(const PT& p) const {
            return x*p.x+y*p.y;
        }
        long long operator^(const PT& p) const {
            return x*p.y-y*p.x;
        }
};

class ND{
    public:
        ND* nx[MAXH+1];
        ND* pr[MAXH+1];
        PT p;
        int h;
        ND() {}
        ND(const PT& _p,int _h=0) {
            int x,i;
            if(_h) {
                h = _h;
            }else {
                x = rand()&((1<<MAXH)-1);
                for( h=0; x&(1<<h); h++ );
            }
            p = _p;
            for( i=0; i<=h; i++ ) {
                nx[i] = pr[i] = this;
            }
        }
        void insert(ND* d,int s=0) {
            int i;
            for( i=s; i<=h && i<=d->h; i++ ) {
                d->nx[i] = nx[i];
                d->pr[i] = this;
                nx[i]->pr[i] = d;
                nx[i] = d;
            }
            if(i<=d->h) pr[h]->insert(d,h+1);
        }
        ND* del() {
            int i;
            ND* t;
            t = nx[0];
            for( i=0; i<=h; i++ ) {
                nx[i]->pr[i] = pr[i];
                pr[i]->nx[i] = nx[i];
            }
            delete this;
            return t;
        }
};

ND *head;

inline long long tri(PT p1,PT p2,PT p3) {
    return (p2-p1)^(p3-p1);
}

inline int inside(PT p) {
    ND *L,*R,*M;
    int h;
    L = head;
    R = head->pr[0];
    if(tri(R->p,L->p,p)<0) return 0;
    h = L->h;
    while(L->nx[h]==L) h--;
    while(1) {
        while(h>=0 && (M=L->nx[h])==R) h--;
        if(h<0) break;
        if(tri(L->p,M->p,p)<0) {
            R = M;
        }else if(tri(M->p,R->p,p)<0) {
            L = M;
        }else {
            return 1;
        }
    }
    return 0;
}

inline void insert(PT p) {
    ND *L,*R,*M;
    int h;
    L = head;
    R = head->pr[0];
    if(tri(R->p,L->p,p)<=0) {
        if(tri(R->p,L->p,p)==0 && (R->p-p)*(L->p-p)<=0) return;
        swap(L,R);
        while(tri(L->pr[0]->p,L->p,p)<=0) L = L->del()->pr[0];
        if(tri(R->p,R->nx[0]->p,p)<=0) {
            R = R->nx[0];
            while(tri(R->p,R->nx[0]->p,p)<=0) R = R->del();
            head->p = p;
        }else {
            L->insert(new ND(p));
        }
    }else {
        h = L->h;
        while(L->nx[h]==L) h--;
        while(1) {
            while(h>=0 && (M=L->nx[h])==R) h--;
            if(h<0) break;
            if(tri(L->p,M->p,p)<0) {
                R = M;
            }else if(tri(M->p,R->p,p)<0) {
                L = M;
            }else {
                return;
            }
        }
        while(tri(L->pr[0]->p,L->p,p)<=0) L = L->del()->pr[0];
        while(tri(R->p,R->nx[0]->p,p)<=0) R = R->del();
        L->insert(new ND(p));
    }
}

int main() {
    srand(88213);
    int QQ,qq,tp,tx,ty;
    PT p,p1,p2,p3,C;
    scanf("%d",&QQ);
    scanf("%d %d %d",&tp,&tx,&ty);
    p1 = PT(tx,ty);
    scanf("%d %d %d",&tp,&tx,&ty);
    p2 = PT(tx,ty);
    scanf("%d %d %d",&tp,&tx,&ty);
    p3 = PT(tx,ty);
    if(tri(p1,p2,p3)<0) {
        swap(p2,p3);
    }
    head = new ND(p1,MAXH);
    head->insert(new ND(p3));
    head->insert(new ND(p2));
    for( qq=3; qq<QQ; qq++ ) {
        scanf("%d %d %d",&tp,&tx,&ty);
        p = PT(tx,ty);
        if(tp==1) {
            insert(p);
        }else {
            puts(inside(p)?"YES":"NO");
        }
    }
    return 0;
}


#include <stdio.h>
#include <algorithm>
#include <stdlib.h>

using namespace std;

#define MAXH 5

class PT{
    public:
        long long x,y;
        PT(){}
        PT(long long _x,long long _y) {
            x = _x; y = _y;
        }
        PT operator+(const PT& p) const {
            return PT(x+p.x,y+p.y);
        }
        PT operator-(const PT& p) const {
            return PT(x-p.x,y-p.y);
        }
        long long operator*(const PT& p) const {
            return x*p.x+y*p.y;
        }
        long long operator^(const PT& p) const {
            return x*p.y-y*p.x;
        }
};

class ND{
    public:
        ND* nx[MAXH+1];
        ND* pr[MAXH+1];
        PT p;
        int h;
        ND() {}
        ND(const PT& _p,int _h=0) {
            int x,i;
            if(_h) {
                h = _h;
            }else {
                x = rand()&((1<<MAXH)-1);
                for( h=0; x&(1<<h); h++ );
            }
            p = _p;
            for( i=0; i<=h; i++ ) {
                nx[i] = pr[i] = this;
            }
        }
        void insert(ND* d,int s=0) {
            int i;
            for( i=s; i<=h && i<=d->h; i++ ) {
                d->nx[i] = nx[i];
                d->pr[i] = this;
                nx[i]->pr[i] = d;
                nx[i] = d;
            }
            if(i<=d->h) pr[h]->insert(d,h+1);
        }
        ND* del() {
            int i;
            ND* t;
            t = nx[0];
            for( i=0; i<=h; i++ ) {
                nx[i]->pr[i] = pr[i];
                pr[i]->nx[i] = nx[i];
            }
            delete this;
            return t;
        }
};

ND *head;

inline long long tri(PT p1,PT p2,PT p3) {
    return (p2-p1)^(p3-p1);
}

inline int inside(PT p) {
    ND *L,*R,*M;
    int h;
    L = head;
    R = head->pr[0];
    if(tri(R->p,L->p,p)<0) return 0;
    h = L->h;
    while(L->nx[h]==L) h--;
    while(1) {
        while(h>=0 && (M=L->nx[h])==R) h--;
        if(h<0) break;
        if(tri(L->p,M->p,p)<0) {
            R = M;
        }else if(tri(M->p,R->p,p)<0) {
            L = M;
        }else {
            return 1;
        }
    }
    return 0;
}

inline void insert(PT p) {
    ND *L,*R,*M;
    int h;
    L = head;
    R = head->pr[0];
    if(tri(R->p,L->p,p)<=0) {
        if(tri(R->p,L->p,p)==0 && (R->p-p)*(L->p-p)<=0) return;
        swap(L,R);
        while(tri(L->pr[0]->p,L->p,p)<=0) L = L->del()->pr[0];
        if(tri(R->p,R->nx[0]->p,p)<=0) {
            R = R->nx[0];
            while(tri(R->p,R->nx[0]->p,p)<=0) R = R->del();
            head->p = p;
        }else {
            L->insert(new ND(p));
        }
    }else {
        h = L->h;
        while(L->nx[h]==L) h--;
        while(1) {
            while(h>=0 && (M=L->nx[h])==R) h--;
            if(h<0) break;
            if(tri(L->p,M->p,p)<0) {
                R = M;
            }else if(tri(M->p,R->p,p)<0) {
                L = M;
            }else {
                return;
            }
        }
        while(tri(L->pr[0]->p,L->p,p)<=0) L = L->del()->pr[0];
        while(tri(R->p,R->nx[0]->p,p)<=0) R = R->del();
        L->insert(new ND(p));
    }
}

int main() {
    srand(88213);
    int QQ,qq,tp,tx,ty;
    PT p,p1,p2,p3,C;
    scanf("%d",&QQ);
    scanf("%d %d %d",&tp,&tx,&ty);
    p1 = PT(tx,ty);
    scanf("%d %d %d",&tp,&tx,&ty);
    p2 = PT(tx,ty);
    scanf("%d %d %d",&tp,&tx,&ty);
    p3 = PT(tx,ty);
    if(tri(p1,p2,p3)<0) {
        swap(p2,p3);
    }
    head = new ND(p1,MAXH);
    head->insert(new ND(p3));
    head->insert(new ND(p2));
    for( qq=3; qq<QQ; qq++ ) {
        scanf("%d %d %d",&tp,&tx,&ty);
        p = PT(tx,ty);
        if(tp==1) {
            insert(p);
        }else {
            puts(inside(p)?"YES":"NO");
        }
    }
    return 0;
}


#include <stdio.h>
#include <algorithm>
#include <stdlib.h>

using namespace std;

#define MAXH 16

class PT{
    public:
        long long x,y;
        PT(){}
        PT(long long _x,long long _y) {
            x = _x; y = _y;
        }
        PT operator+(const PT& p) const {
            return PT(x+p.x,y+p.y);
        }
        PT operator-(const PT& p) const {
            return PT(x-p.x,y-p.y);
        }
        long long operator^(const PT& p) const {
            return x*p.y-y*p.x;
        }
};

class ND{
    public:
        ND* nx[MAXH+1];
        ND* pr[MAXH+1];
        PT p;
        int h;
        ND() {}
        ND(const PT& _p,int _h=0) {
            int x,i;
            if(_h) {
                h = _h;
            }else {
                x = rand()&((1<<MAXH)-1);
                for( h=0; x&(1<<h); h++ );
            }
            p = _p;
            for( i=0; i<=h; i++ ) {
                nx[i] = pr[i] = this;
            }
        }
        void insert(ND* d,int s=0) {
            int i;
            for( i=s; i<=h && i<=d->h; i++ ) {
                d->nx[i] = nx[i];
                d->pr[i] = this;
                nx[i]->pr[i] = d;
                nx[i] = d;
            }
        }
        ND* del() {
            int i;
            ND* t;
            t = nx[0];
            for( i=0; i<=h; i++ ) {
                nx[i]->pr[i] = pr[i];
                pr[i]->nx[i] = nx[i];
            }
            delete this;
            return t;
        }
        void prt() {
            ND *t;
            t = this;
            do {
                printf("%lld %lld  %d\n",t->p.x,t->p.y,t->h);
                t = t->nx[0];
            }while(t!=nx[h]);
        }
};

ND *head;

inline long long tri(PT p1,PT p2,PT p3) {
    return (p2-p1)^(p3-p1);
}

inline int inside(PT p) {
    ND *L,*R,*M;
    int h;
    L = head;
    R = head->pr[0];
    if(tri(R->p,L->p,p)<0) return 0;
    h = L->h;
    while(L->nx[h]==L) h--;
    while(1) {
        while(h>=0 && (M=L->nx[h])==R) h--;
        if(h<0) break;
        if(tri(L->p,M->p,p)<0) {
            R = M;
        }else if(tri(M->p,R->p,p)<0) {
            L = M;
        }else {
            return 1;
        }
    }
    return 0;
}

inline void insert(PT p) {
    ND *L,*R,*M;
    int h;
    L = head;
    R = head->pr[0];
    if(tri(R->p,L->p,p)<0) {
        swap(L,R);
        while(tri(L->pr[0]->p,L->p,p)<=0) L = L->del()->pr[0];
        if(tri(R->p,R->nx[0]->p,p)<=0) {
            R = R->nx[0];
            while(tri(R->p,R->nx[0]->p,p)<=0) R = R->del();
            head->p = p;
        }else {
            L->insert(new ND(p));
        }
    }else {
        h = L->h;
        while(L->nx[h]==L) h--;
        while(1) {
            while(h>=0 && (M=L->nx[h])==R) h--;
            if(h<0) break;
            if(tri(L->p,M->p,p)<0) {
                R = M;
            }else if(tri(M->p,R->p,p)<0) {
                L = M;
            }else {
                return;
            }
        }
        while(tri(L->pr[0]->p,L->p,p)<=0) L = L->del()->pr[0];
        while(tri(R->p,R->nx[0]->p,p)<=0) R = R->del();
        L->insert(new ND(p));
    }
}

int main() {
    srand(88213);
    int QQ,qq,tp,tx,ty;
    PT p,p1,p2,p3,C;
    scanf("%d",&QQ);
    scanf("%d %d %d",&tp,&tx,&ty);
    p1 = PT(tx,ty);
    scanf("%d %d %d",&tp,&tx,&ty);
    p2 = PT(tx,ty);
    scanf("%d %d %d",&tp,&tx,&ty);
    p3 = PT(tx,ty);
    if(tri(p1,p2,p3)<0) {
        swap(p2,p3);
    }
    head = new ND(p1,MAXH);
    head->insert(new ND(p3));
    head->insert(new ND(p2));
    for( qq=3; qq<QQ; qq++ ) {
        scanf("%d %d %d",&tp,&tx,&ty);
        p = PT(tx,ty);
        if(tp==1) {
            insert(p);
        }else {
            puts(inside(p)?"YES":"NO");
        }
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define dbgs(x) cerr << (#x) << " --> " << (x) << ' '
#define dbg(x) cerr << (#x) << " --> " << (x) << endl

#define foreach(i,x) for(type(x)i=x.begin();i!=x.end();i++)
#define FOR(ii,aa,bb) for(int ii=aa;ii<=bb;ii++)
#define ROF(ii,aa,bb) for(int ii=aa;ii>=bb;ii--)

#define type(x) __typeof(x.begin())

#define orta (bas + son >> 1)
#define sag (k + k + 1)
#define sol (k + k)

#define pb push_back
#define mp make_pair

#define nd second
#define st first

#define endl '\n'

typedef pair < int ,int > pii;

typedef long long ll;

const int inf = 1e9, mod = 1e9+7;
const int N = 1e5+5;

int x, y, x2, y2, x3, y3, n, m, type, rubbish, ox, oy;

set< pair< double , pii > > S;
set< pair< double , pii > > :: iterator l, r, temp, _1, _2;

set< pair< double , pii > > :: iterator next(set< pair< double , pii > > :: iterator x){
	x++; if(x == S.end()) return S.begin();
	return x;
}

set< pair< double , pii > > :: iterator prev(set< pair< double , pii > > :: iterator x){
	if(x == S.begin()) return S.find(*S.rbegin());
	x--; return x;
}

int ccw(pii x,pii xx,pii xx2){ return (xx.st-x.st) * (xx2.nd-x.nd) - (xx.nd-x.nd) * (xx2.st-x.st); }

bool inside(int x,int y){
	r = S.lower_bound(mp(atan2(y-oy,x-ox),mp(x,y)));
	if(r == S.end())r = next(r); l = prev(r);
	if(ccw(r->nd,mp(x,y),l->nd) >= 0) return 1;
	return 0;
}

void add(int x,int y){
	_1 = S.upper_bound(mp(atan2(y-oy,x-ox),mp(x,y)));
	if(_1 == S.end()) _1 = next(_1); _2 = next(_1);
	while(ccw(_2->nd,_1->nd,mp(x,y)) >= 0){ S.erase(_1); _1 = _2; _2 = next(_1); }
	_1 = prev(S.upper_bound(mp(atan2(y-oy,x-ox),mp(x,y))));
	_2 = prev(_1);
	while(ccw(mp(x,y),_2->nd,_1->nd) <= 0){ S.erase(_1); _1 = _2; _2 = prev(_1); }
	S.insert(mp(atan2(y-oy,x-ox),mp(x,y)));
}

int main(){

	scanf("%d",&m);

	scanf("%d %d %d",&rubbish,&x,&y);
	scanf("%d %d %d",&rubbish,&x2,&y2);
	scanf("%d %d %d",&rubbish,&x3,&y3);

	ox = (x + x2 + x3);
	oy = (y + y2 + y3);

	x *= 3; x2 *= 3; x3 *= 3;
	y *= 3; y2 *= 3; y3 *= 3;

	S.insert(mp(atan2(y-oy,x-ox),mp(x,y)));
	S.insert(mp(atan2(y2-oy,x2-ox),mp(x2,y2)));
	S.insert(mp(atan2(y3-oy,x3-ox),mp(x3,y3)));

	FOR(i,4,m){

		scanf("%d %d %d",&type,&x,&y); x = x + x + x; y = y + y + y;

		if(type == 1) {
			if(inside(x,y)) continue;
			add(x,y);
		} else {
			if(inside(x,y)) puts("YES");
			else puts("NO");
		}
	}

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define dbgs(x) cerr << (#x) << " --> " << (x) << ' '
#define dbg(x) cerr << (#x) << " --> " << (x) << endl

#define foreach(i,x) for(type(x)i=x.begin();i!=x.end();i++)
#define FOR(ii,aa,bb) for(int ii=aa;ii<=bb;ii++)
#define ROF(ii,aa,bb) for(int ii=aa;ii>=bb;ii--)

#define type(x) __typeof(x.begin())

#define orta (bas + son >> 1)
#define sag (k + k + 1)
#define sol (k + k)

#define pb push_back
#define mp make_pair

#define nd second
#define st first

#define endl '\n'

typedef pair < int ,int > pii;

typedef long long ll;

const int inf = 1e9, mod = 1e9+7;
const int N = 1e5+5;

int x, y, x2, y2, x3, y3, n, m, type, rubbish, ox, oy;

set< pair< double , pii > > S;
set< pair< double , pii > > :: iterator l, r, temp, _1, _2;

set< pair< double , pii > > :: iterator next(set< pair< double , pii > > :: iterator x){
	if(x == S.end()) x = S.begin();
	x++; if(x == S.end()) return S.begin();
	return x;
}

set< pair< double , pii > > :: iterator prev(set< pair< double , pii > > :: iterator x){
	if(x == S.begin()) return S.find(*S.rbegin());
	x--; return x;
}

ll ccw(pii x,pii xx,pii xx2){ return (ll)(xx.st-x.st) * (xx2.nd-x.nd) - (ll)(xx.nd-x.nd) * (xx2.st-x.st); }

bool inside(int x,int y){
	r = S.lower_bound(mp(atan2(y-oy,x-ox),mp(x,y)));
	if(r == S.end()) r = S.begin(); l = prev(r);
	if(ccw(r->nd,mp(x,y),l->nd) >= 0) return 1;
	return 0;
}

void add(int x,int y){
	l = S.lower_bound(mp(atan2(y-oy,x-ox),mp(x,y)));
	if(l == S.end()) l = S.begin(); r = prev(l);
	while(ccw(mp(x,y),next(l)->nd,l->nd) >= 0){ temp = l; l = next(l); S.erase(temp); }
	while(ccw(mp(x,y),prev(r)->nd,r->nd) <= 0){ temp = r; r = prev(r); S.erase(temp); }
	S.insert(mp(atan2(y-oy,x-ox),mp(x,y)));
}

int main(){

	scanf("%d",&m);

	scanf("%d %d %d",&rubbish,&x,&y);
	scanf("%d %d %d",&rubbish,&x2,&y2);
	scanf("%d %d %d",&rubbish,&x3,&y3);

	ox = (x + x2 + x3);
	oy = (y + y2 + y3);

	x *= 3; x2 *= 3; x3 *= 3;
	y *= 3; y2 *= 3; y3 *= 3;

	S.insert(mp(atan2(y-oy,x-ox),mp(x,y)));
	S.insert(mp(atan2(y2-oy,x2-ox),mp(x2,y2)));
	S.insert(mp(atan2(y3-oy,x3-ox),mp(x3,y3)));

	FOR(i,4,m){

		scanf("%d %d %d",&type,&x,&y); x = x + x + x; y = y + y + y;

		if(type == 1) {
			if(inside(x,y)) continue;
			add(x,y);
		} else {
			if(inside(x,y)) puts("YES");
			else puts("NO");
		}
	}

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define dbgs(x) cerr << (#x) << " --> " << (x) << ' '
#define dbg(x) cerr << (#x) << " --> " << (x) << endl

#define foreach(i,x) for(type(x)i=x.begin();i!=x.end();i++)
#define FOR(ii,aa,bb) for(int ii=aa;ii<=bb;ii++)
#define ROF(ii,aa,bb) for(int ii=aa;ii>=bb;ii--)

#define type(x) __typeof(x.begin())

#define orta (bas + son >> 1)
#define sag (k + k + 1)
#define sol (k + k)

#define pb push_back
#define mp make_pair

#define nd second
#define st first

#define endl '\n'

typedef pair < int ,int > pii;

typedef long long ll;

const int inf = 1e9, mod = 1e9+7;
const int N = 1e5+5;

int x, y, x2, y2, x3, y3, n, m, type, rubbish, ox, oy;

set< pair< double , pii > > S;
set< pair< double , pii > > :: iterator l, r, temp, _1, _2;

set< pair< double , pii > > :: iterator next(set< pair< double , pii > > :: iterator x){
	if(x == S.end()) return S.begin();
	x--; return x;
}

set< pair< double , pii > > :: iterator prev(set< pair< double , pii > > :: iterator x){
	if(x == S.begin()) return S.find(*S.rbegin());
	x--; return x;
}

int ccw(pii x,pii xx,pii xx2){ return (xx.st-x.st) * (xx2.nd-x.nd) - (xx.nd-x.nd) * (xx2.st-x.st); }

bool inside(int x,int y){
	r = S.lower_bound(mp(atan2(y-oy,x-ox),mp(x,y)));
	if(r == S.end())r = next(r); l = prev(r);
	if(ccw(r->nd,mp(x,y),l->nd) >= 0) return 1;
	return 0;
}

void add(int x,int y){
	_1 = S.upper_bound(mp(atan2(y-oy,x-ox),mp(x,y)));
	if(_1 == S.end()) _1 = next(_1); _2 = next(_1);
	while(ccw(_2->nd,_1->nd,mp(x,y)) >= 0){ S.erase(_1); _1 = _2; _2 = next(_1); }
	_1 = prev(S.upper_bound(mp(atan2(y-oy,x-ox),mp(x,y)))); _2 = prev(_1);
	while(ccw(mp(x,y),_2->nd,_1->nd) <= 0){ S.erase(_1); _1 = _2; _2 = prev(_1); }
	S.insert(mp(atan2(y-oy,x-ox),mp(x,y)));
}

int main(){

	scanf("%d",&m);

	scanf("%d %d %d",&rubbish,&x,&y);
	scanf("%d %d %d",&rubbish,&x2,&y2);
	scanf("%d %d %d",&rubbish,&x3,&y3);

	ox = (x + x2 + x3);
	oy = (y + y2 + y3);

	x *= 3; x2 *= 3; x3 *= 3;
	y *= 3; y2 *= 3; y3 *= 3;

	S.insert(mp(atan2(y-oy,x-ox),mp(x,y)));
	S.insert(mp(atan2(y2-oy,x2-ox),mp(x2,y2)));
	S.insert(mp(atan2(y3-oy,x3-ox),mp(x3,y3)));

	FOR(i,4,m){

		scanf("%d %d %d",&type,&x,&y); x = x + x + x; y = y + y + y;

		if(type == 1) {
			if(inside(x,y)) continue;
			add(x,y);
		} else {
			if(inside(x,y)) puts("YES");
			else puts("NO");
		}
	}

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define dbgs(x) cerr << (#x) << " --> " << (x) << ' '
#define dbg(x) cerr << (#x) << " --> " << (x) << endl

#define foreach(i,x) for(type(x)i=x.begin();i!=x.end();i++)
#define FOR(ii,aa,bb) for(int ii=aa;ii<=bb;ii++)
#define ROF(ii,aa,bb) for(int ii=aa;ii>=bb;ii--)

#define type(x) __typeof(x.begin())

#define orta (bas + son >> 1)
#define sag (k + k + 1)
#define sol (k + k)

#define pb push_back
#define mp make_pair

#define nd second
#define st first

#define endl '\n'

typedef pair < int ,int > pii;

typedef long long ll;

const int inf = 1e9, mod = 1e9+7;
const int N = 1e5+5;

int x, y, x2, y2, x3, y3, n, m, type, rubbish, ox, oy;

set< pair< double , pii > > S;
set< pair< double , pii > > :: iterator l, r, temp, _1, _2;

set< pair< double , pii > > :: iterator next(set< pair< double , pii > > :: iterator x){
	if(x == S.end()) x = S.begin();
	x++; if(x == S.end()) return S.begin();
	return x;
}

set< pair< double , pii > > :: iterator prev(set< pair< double , pii > > :: iterator x){
	if(x == S.begin()) return S.find(*S.rbegin());
	x--; return x;
}

int ccw(pii x,pii xx,pii xx2){ return (xx.st-x.st) * (xx2.nd-x.nd) - (xx.nd-x.nd) * (xx2.st-x.st); }

bool inside(int x,int y){
	r = S.lower_bound(mp(atan2(y-oy,x-ox),mp(x,y)));
	if(r == S.end()) r = S.begin(); l = prev(r);
	if(ccw(r->nd,mp(x,y),l->nd) >= 0) return 1;
	return 0;
}

void add(int x,int y){
	l = S.lower_bound(mp(atan2(y-oy,x-ox),mp(x,y)));
	if(l == S.end()) l = S.begin(); r = prev(l);
	while(ccw(mp(x,y),next(l)->nd,l->nd) >= 0){ temp = l; l = next(l); S.erase(temp); }
	while(ccw(mp(x,y),prev(r)->nd,r->nd) <= 0){ temp = r; r = prev(r); S.erase(temp); }
	S.insert(mp(atan2(y-oy,x-ox),mp(x,y)));
}

int main(){

	scanf("%d",&m);

	scanf("%d %d %d",&rubbish,&x,&y);
	scanf("%d %d %d",&rubbish,&x2,&y2);
	scanf("%d %d %d",&rubbish,&x3,&y3);

	ox = (x + x2 + x3);
	oy = (y + y2 + y3);

	x *= 3; x2 *= 3; x3 *= 3;
	y *= 3; y2 *= 3; y3 *= 3;

	S.insert(mp(atan2(y-oy,x-ox),mp(x,y)));
	S.insert(mp(atan2(y2-oy,x2-ox),mp(x2,y2)));
	S.insert(mp(atan2(y3-oy,x3-ox),mp(x3,y3)));

	FOR(i,4,m){

		scanf("%d %d %d",&type,&x,&y); x = x + x + x; y = y + y + y;

		if(type == 1) {
			if(inside(x,y)) continue;
			add(x,y);
		} else {
			if(inside(x,y)) puts("YES");
			else puts("NO");
		}
	}

    return 0;
}


#include <cstdio>
#include <cmath>

#include <algorithm>
#include <map>

typedef std::map<int, int> map;
typedef map::iterator iterator;
typedef int num;
typedef long long ll;

map top, down;

ll det(int x1, int y1, int x2, int y2);
bool check_top(int x, int y);
bool check_down(int x, int y);
bool remove_top(iterator it);
bool remove_down(iterator it);
void insert_top(int x, int y);
void insert_down(int x, int y);

int main() {
    int q, op, x, y;
    scanf("%d", &q);
    while (q--) {
        scanf("%d%d%d", &op, &x, &y);
        if (op == 1) {
            insert_top(x, y);
            insert_down(x, y);
        } else
            puts((check_top(x, y) && check_down(x, y)) ? "YES" : "NO");
    }
    return 0;
}

void insert_top(int x, int y) {
    if (check_top(x, y))
        return;
    top[x] = y;
    iterator it = top.find(x);
    iterator jt = it;
    if (it != top.begin()) {
        --jt;
        while (remove_top(jt++))
            --jt;
    }
    if (++jt != top.end())
        while (remove_top(jt--))
            ++jt;
}

ll det(int x1, int y1, int x2, int y2) {
    return (ll)x1 * y2 - (ll)x2 * y1;
}

void insert_down(int x, int y) {
    if (check_down(x, y))
        return;
    down[x] = y;
    iterator it = down.find(x);
    iterator jt = it;
    if (it != down.begin()) {
        --jt;
        while (remove_down(jt++))
            --jt;
    }
    if (++jt != down.end())
        while (remove_down(jt--))
            ++jt;
}

bool remove_top(iterator it) {
    if (it == top.begin())
        return false;
    iterator jt = it, kt = it;
    --jt;
    ++kt;
    if (kt == top.end())
        return false;
    if (det(it->first - jt->first, it->second - jt->second, kt->first - jt->first, kt->second - jt->second) >= 0) {
        top.erase(it);
        return true;
    }
    return false;
}

bool remove_down(iterator it) {
    if (it == down.begin())
        return false;
    iterator jt = it, kt = it;
    --jt;
    ++kt;
    if (kt == down.end())
        return false;
    if (det(it->first - jt->first, it->second - jt->second, kt->first - jt->first, kt->second - jt->second) <= 0) {
        down.erase(it);
        return true;
    }
    return false;
}

bool check_top(int x, int y) {
    iterator it = top.lower_bound(x);
    if (it == top.end())
        return false;
    if (it->first == x)
        return y <= it->second;
    if (it == top.begin())
        return false;
    iterator jt = it;
    --jt;
    return det(it->first - jt->first, it->second - jt->second, x - jt->first, y - jt->second) <= 0;
}

bool check_down(int x, int y) {
    iterator it = down.lower_bound(x);
    if (it == down.end())
        return false;
    if (it->first == x)
        return y >= it->second;
    if (it == down.begin())
        return false;
    iterator jt = it;
    --jt;
    return det(it->first - jt->first, it->second - jt->second, x - jt->first, y - jt->second) >= 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef map<int, int>px;
inline int read(){
    int X=0,w=0; char ch=0;
    while(!isdigit(ch)) {w|=ch=='-';ch=getchar();}
    while(isdigit(ch)) X=(X<<3)+(X<<1)+(ch^48),ch=getchar();
    return w?-X:X;
}
struct cof{
    int x, y;
    cof() {}
    cof(int x, int y): x(x), y(y) {}
    cof(px::iterator it):x(it->first),y(it->second){}
    cof operator -(const cof&C)const {
        return cof(x-C.x,y-C.y);
    }
};
 int js1(const cof& a,const cof& b){
    return (long long)a.x*b.y-(long long)b.x*a.y;
}
 int js2(const cof&o,const cof& a,const cof& b){
    return js1(a-o,b-o);
}
 int pd(px &mp,cof p) {
    if(mp.empty())return 0;
    if(p.x<mp.begin()->first||mp.rbegin()->first<p.x)return 0;;
    px::iterator a=mp.lower_bound(p.x),b=a--;
    if(b->first==p.x) return b->second >= p.y;
    if(js2(a, b, p)>0)return 0;
    return 1;
}

  void update(px &mp,cof p) {
    if(pd(mp, p)) return ;
    px::iterator a, b, it;
    mp[p.x] = p.y;
    it=mp.lower_bound(p.x);
    b=it;++b;
    if(b!=mp.end()) {
        a=b++;
        while(b!= mp.end()&&js2(p, a, b) >= 0){
        mp.erase(a);a = b++;
        }
    }
    a=it;--a;
    if(it!=mp.begin()&&a != mp.begin()) {
        b = a--;
        while(b != mp.begin() &&js2(p, b, a)<=0){
        	mp.erase(b);b=a--;
        }

    }
}
px pp1,pp2;
int main(){
    int q,op,x,y;//=read();
    scanf("%d",&q);
    while(q--) {
    	scanf("%d%d%d",&op,&x,&y);
    	//int op=read(),x=read(),y=read();
        if(op==1){
            update(pp1,cof(x,y));
            update(pp2,cof(x,-y));

        }
        else {if(pd(pp1,cof(x,y))&&pd(pp2,cof(x, -y)))printf("YES\n");
             else        printf("NO\n"); }
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
using namespace std;
typedef map<int, int>px;
inline int read(){
    int X=0,w=0; char ch=0;
    while(!isdigit(ch)) {w|=ch=='-';ch=getchar();}
    while(isdigit(ch)) X=(X<<3)+(X<<1)+(ch^48),ch=getchar();
    return w?-X:X;
}
struct cof{
    int x, y;
    cof() {}
    cof(int x, int y): x(x), y(y) {}
    cof(px::iterator it):x(it->first),y(it->second){}
    cof operator -(const cof&C)const {
        return cof(x-C.x,y-C.y);
    }
};
inline int js1(const cof& a,const cof& b){
	return a.x*b.y-b.x*a.y;
}
inline int js2(const cof&o,const cof& a,const cof& b){
	return js1(a-o,b-o);
}
inline int pd(px &mp,cof p) {
    if(mp.empty())return 0;
    if(p.x<mp.begin()->first||mp.rbegin()->first<p.x)return 0;;
    px::iterator a=mp.lower_bound(p.x),b=a--;
    if(b->first==p.x) return b->second >= p.y;
	if(js2(a, b, p)>0)return 0;
	return 1;
}

inline void update(px &mp,cof p) {
    if(pd(mp, p)) return ;
    px::iterator a, b, it;
    mp[p.x] = p.y;
    it=mp.lower_bound(p.x);
    b=it;b++;
    if(b!=mp.end()) {
        a=b++;
        while(b!= mp.end()&&js2(p, a, b) >= 0){
		mp.erase(a);a = b++;
		}
    }
    a=it;a--;
    if(it!=mp.begin()&&a != mp.begin()) {
        b = a--;
        while(b != mp.begin() &&js2(p, b, a)<=0){
        	mp.erase(b);b=a--;
        }

    }
}
px pp1,pp2;
int main(){
	int q=read();
    while(q--) {
    	int op=read(),x=read(),y=read();
        if(op==1){
            update(pp1,cof(x,y));
            update(pp2,cof(x,-y));
            continue;
	    }
        if(pd(pp1,cof(x,y))&&pd(pp2,cof(x, -y))){printf("YES\n");continue;}
        printf("NO\n");
    }
    return 0;
}