Language: C++

#include<bits/stdc++.h>
using namespace std;

typedef pair<int,int>pint;
typedef vector<int>vint;
#define pb push_back
#define mp make_pair
#define rep(i,n) for(int i=0;i<(n);i++)
template<class T,class U>void chmin(T &t,U f){if(t>f)t=f;}
template<class T,class U>void chmax(T &t,U f){if(t<f)t=f;}

typedef complex<double>P;

const double EPS=1e-9;
const double PI=acos(-1);

const int COUNTER_CLOCKWISE=1;
const int CLOCKWISE=-1;
const int ONLINE_BACK=2;
const int ONLINE_FRONT=-2;
const int ON_SEGMENT=0;

inline double dot(const P &a, const P &b){return (conj(a) * b).real();}
inline double cross(const P &a, const P &b){return (conj(a) * b).imag();}

double toRad(double a){return a/180.0*PI;}
double toDeg(double a){return a*180.0/PI;}
P rotate(P p,double d){
    return P(p.real()*cos(d)-p.imag()*sin(d),p.real()*sin(d)+p.imag()*cos(d));
}

P getP(){
    double x,y;
    scanf("%lf%lf",&x,&y);
    return P(x,y);
}

int ccw(P p0,P p1,P p2){
    P a=p1-p0;
    P b=p2-p0;
    if(cross(a,b)>EPS)return COUNTER_CLOCKWISE;
    if(cross(a,b)<-EPS)return CLOCKWISE;
    if(dot(a,b)<-EPS)return ONLINE_BACK;
    if(norm(a)<norm(b))return ONLINE_FRONT;
    return ON_SEGMENT;
}

bool ok(P from,P to,double w,double a,double d){
    if(abs(to-from)>a)return false;

    w=toRad(w);
    d=toRad(d);

    P p0=from+P(cos(w),sin(w))*a;
    P p1=rotate(p0,-d/2);
    P p2=rotate(p0,d/2);
    
    return (cross(from,p1,to)>EPS)&&(cross(from,p2,to)<EPS);
}

int H,R;
vector<P>h;

int U,M,S;
double du,dm,ds;
vector<P>u,m,s;
void solve(){
    h.resize(H);
    rep(i,H)h[i]=getP();

    scanf("%d%d%d",&U,&M,&S);
    scanf("%lf%lf%lf",&du,&dm,&ds);

    u.resize(U);
    m.resize(M);
    s.resize(S);
    rep(i,U)u[i]=getP();
    rep(i,M)m[i]=getP();
    rep(i,S)s[i]=getP();

    int cnt[100]={0};

    while(R--){
        double w,a;
        scanf("%lf%lf",&w,&a);
        rep(i,H){
            bool f=false;
            if(ok(P(0,0),h[i],w,a,du))f=true;
            rep(j,U)if(ok(u[j],h[i],w,a,du))f=false;
            rep(j,M)if(ok(m[j],h[i],w,a,dm))f=false;
            rep(j,S)if(ok(s[j],h[i],w,a,ds))f=false;
            if(f)cnt[i]++;
        }
    }

    int ma=*max_element(cnt,cnt+H);
    if(ma==0){
        puts("NA");
        return;
    }

    bool f=false;
    rep(i,H){
        if(cnt[i]!=ma)continue;
        if(f)printf(" ");
        else f=true;
        printf("%d",i+1);
    }
    puts("");
}

int main(){
    while(scanf("%d%d",&H,&R),H||R)solve();
    return 0;
}

Compiler output:
a.cc: In function 'bool ok(P, P, double, double, double)':
a.cc:58:18: error: too many arguments to function 'double cross(const P&, const P&)'
   58 |     return (cross(from,p1,to)>EPS)&&(cross(from,p2,to)<EPS);
      |             ~~~~~^~~~~~~~~~~~
a.cc:24:15: note: declared here
   24 | inline double cross(const P &a, const P &b){return (conj(a) * b).imag();}
      |               ^~~~~
a.cc:58:43: error: too many arguments to function 'double cross(const P&, const P&)'
   58 |     return (cross(from,p1,to)>EPS)&&(cross(from,p2,to)<EPS);
      |                                      ~~~~~^~~~~~~~~~~~
a.cc:24:15: note: declared here
   24 | inline double cross(const P &a, const P &b){return (conj(a) * b).imag();}
      |               ^~~~~