###### 【O(nlgn)判定点在凸包内】Codeforces Round #113 (Div. 2) B

#define N 100005
struct node{
double x,y;
}a[100005];
double cross(node a,node b,node c){//>0，ab在ac顺时针；<0，ab在ac逆时针
return (b.x-a.x)*(c.y-a.y) - (c.x-a.x)*(b.y-a.y);
}
int n,m;
bool chk(node b){
int i,j;
if(cross(a[0],b,a[1]) <= 0)return false;
if(cross(a[0],b,a[n-1]) >= 0)return false;
int l = 0,r = n-1,mid;
int tag = 0;
while(l<=r){
mid = (l+r)>>1;
if(cross(a[0],b,a[mid]) >= 0){
tag = mid;
l = mid+1;
} else r = mid-1;
}
l = tag,r = tag+1;
if(cross(a[l],b,a[r]) <= 0)return false;
return true;
}

int main(){
cin>>n;
int i,j;
for(i=0;i<n;i++){
cin>>a[i].x>>a[i].y;
}
int ans = 0;
cin>>m;
node b;
for(i=0;i<m;i++){
cin>>b.x>>b.y;
if(chk(b))ans++;
}
if(ans==m)cout<<"YES"<<endl;
else cout<<"NO"<<endl;
return 0;
}

#### Codeforces Round #258 (Div. 2)-(A,B,C,D,E)

2014-07-25 14:39:48

#### Educational Codeforces Round 38 (Rated for Div. 2) B. Run For Your Prize

2018-02-17 13:35:37

#### 【CodeForces】CodeForces Round #464 (Div. 2) 题解

2018-02-18 11:05:43

#### Codeforces Round #482 (Div. 2)

2018-05-15 12:51:24

#### Codeforces Round #444 (Div. 2)-贪心&尺取-Ratings and Reality Shows

2017-11-11 20:11:11

#### Codeforces Round #465 (Div. 2) C. Fifa and Fafa(圆问题，数论)

2018-02-20 16:16:48

#### Codeforces Round #428 (Div. 2) A B C D

2017-08-13 23:16:14

#### Codeforces Round #471 div.2 ABC题解

2018-03-24 14:16:58

#### Codeforces Educational Codeforces Round 41 (Rated for Div. 2) B. Lecture Sleep

2018-04-05 10:35:27

#### Codeforces Round #447 (Div. 2) C. Marco and GCD Sequence (构造 贪心)

2017-11-20 13:19:26

## 不良信息举报

【O(nlgn)判定点在凸包内】Codeforces Round #113 (Div. 2) B