Help me in solving WAV2 problem..my logic is right in this code?

My issue

My code

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

int main() {
	// your code goes here
long long int n,q;
	cin>>n>>q;
	long long	int a[n];
	for(int i=0;i<n;i++){
	    cin>>a[i];
	}
	while(q--){
// 	int a[n];
// 	for(int i=0;i<n;i++){
// 	    cin>>a[i];
// 	}
long	 int x;
	cin>>x;
long long	int y=1;
	for(int i=0;i<n;i++){
	    y*=(x-a[i]);
	}
// 	cin>>x;
	if(y>0){
	    cout<<"POSITIVE"<<endl;
	}
	else if(y<0){
	    cout<<"NEGATIVE"<<endl;
	}
	else cout<<"0"<<endl;}
	return 0;
}

Problem Link: WAV2 Problem - CodeChef