#include<bits/stdc++.h>
using namespace std;
double o[100005], oo[100005], q[100005], qq[100005];
double wee = acos(-1);
int main() {
ios::sync_with_stdio(false), cin.tie(0);
int n, m;
cin>>n>>m;
for(int i = 1; i <= n; i++) {
int x, y;
cin>>x>>y;
o[i] = acos(1.0 * x / sqrt(1.0 * x * x + 1.0 * y * y));
if(y < 0) o[i] = 2 * wee - o[i];
long long yee = o[i] * 10000000000ll;
o[i] = 1.0 * yee / 10000000000ll;
}
for(int i = 1; i <= m; i++) {
int u, v;
cin>>u>>v;
oo[i] = acos(1.0 * u / sqrt(1.0 * u * u + 1.0 * v * v));
if(v < 0) oo[i] = 2 * wee - oo[i];
long long yee = oo[i] * 10000000000ll;
oo[i] = 1.0 * yee / 10000000000ll;
}
sort(o + 1, o + n + 1);
double mc = 0;
for(int i = 1; i <= m; i++) {
double eggy = min(mc, oo[i]), party = max(mc, oo[i]);
int ioi = lower_bound(o + 1, o + n + 1, eggy) - o;
int oi = upper_bound(o + 1, o + n + 1, party) - o;
int cnt = oi - ioi;
ioi = upper_bound(o + 1, o + n + 1, eggy) - o;
oi = lower_bound(o + 1, o + n + 1, party) - o;
cnt = max(cnt, n - oi + ioi);
cout<<cnt;
mc = oo[i];
}
return 0;
}