Problem:
Problem Statement

You are given two integers a and b (a≤b). Determine if the product of the integers a, a+1, …, b is positive, negative or zero.

Constraints

a and b are integers.

-10^9≤a≤b≤10^9

Partial Score

In test cases worth 100 points, -10≤a≤b≤10.

Input

The input is given from Standard Input in the following format:

a b

Output

If the product is positive, print Positive. If it is negative, print Negative. If it is zero, print Zero.

Sample Input 1

1 3

Sample Output 1

Positive

1×2×3=6 is positive.

Sample Input 2

-3 -1

Sample Output 2

Negative

(-3)×(-2)×(-1)=-6 is negative.

Sample Input 3

-1 1

Sample Output 3

Zero

(-1)×0×1=0.

Solution in C++14 (GCC 5.4.1) (judge verdict: Wrong Answer)

//Relive your past life.
//Face your demons.
//The past is never dead,it is not even past.
//The memories are not only the key to the past but...also to the future.
//coded in Rusty Lake
#include<cmath>
#include<math.h>
#include<ctype.h>
#include<algorithm>
#include<bitset>
#include<cassert>
#include<cctype>
#include<cerrno>
#include<cfloat>
#include<ciso646>
#include<climits>
#include<clocale>
#include<complex>
#include<csetjmp>
#include<csignal>
#include<cstdarg>
#include<cstddef>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<ctime>
#include<cwchar>
#include<cwctype>
#include<deque>
#include<exception>
#include<fstream>
#include<functional>
#include<iomanip>
#include<ios>
#include<iosfwd>
#include<iostream>
#include<istream>
#include<iterator>
#include<limits>
#include<list>
#include<locale>
#include<map>
#include<memory>
#include<new>
#include<numeric>
#include<ostream>
#include<queue>
#include<set>
#include<sstream>
#include<stack>
#include<stdexcept>
#include<streambuf>
#include<string>
#include<typeinfo>
#include<utility>
#include<valarray>
#include<vector>
#include<string.h>
#include<stdlib.h>
#include<stdio.h>
#define ll   long long
#define pb   push_back
#define mp   make_pair
#define orz  1000000007
using namespace std;
int n,m,q,f[100005],s[100005],x[100005],y[100005],z[100005],a[100005],b[100005],p[100005],ans[100005],P[100005];
int _;
vector<int> v[20];
int get(int x){return x==f[x]?x:get(f[x]);}
void sol(int l,int r,int L,int R){
    if(L>R) return;
    if(l==r){
        for(int i=L;i<=R;++i)ans[p[i]]=l;
        return;
    }
    int m=(l+r)>>1,le=L,ri=R;
    ++_;
    for(int i=l;i<=m;++i){
        int x=a[i],y=b[i];
        x=get(x),y=get(y);
        if(x!=y){
            if(s[x]<s[y])swap(x,y);
            f[y]=x,s[x]+=s[y],v[_].pb(y);
        }
    }
    for(int i=L;i<=R;++i){
        int a=get(x[p[i]]),b=get(y[p[i]]),sum;
        if(a==b)sum=s[a];
        else sum=s[a]+s[b];
        if(sum>=z[p[i]])P[le++]=p[i];
        else P[ri--]=p[i];
    }
    for(int i=L;i<=R;++i)p[i]=P[i];
    sol(m+1,r,le,R);
    for(int i=v[_].size()-1;i>=0;--i){
        int x=v[_][i];
        s[f[x]]-=s[x],f[x]=x;
    }
    sol(l,m,L,ri);
    v[_].clear();
    --_;
}
int main(){
    scanf("%d%d",&n,&m);
    for(int i=1;i<=m;++i)scanf("%d%d",a+i,b+i);
    scanf("%d",&q);
    for(int i=1;i<=q;++i)scanf("%d%d%d",x+i,y+i,z+i),p[i]=i;
    for(int i=1;i<=n;++i)f[i]=i,s[i]=1;
    sol(1,m,1,q);
    for(int i=1;i<=q;++i)printf("%d\n",ans[i]);
    //system("pause");
    return 0;
}