提交时间:2022-08-08 11:36:06

运行 ID: 54963

#include<bits/stdc++.h> using namespace std; typedef unsigned long long ll; inline ll read() { static ll x=0,c=getchar() ; for(; c<=47||c>=58; c=getchar()); for(x=0; c>=48&&c<=57; c=getchar()) x=(x<<3)+(x<<1)+(c&15); return x; } int main() { ll t,n,p; t=read(); while(t--) { n=read(),p=read(); if(p==1) { if(n==1) cout<<1<<endl; else cout<<-1<<endl; } if(p==2) { if(n==1) cout<<1<<endl; else cout<<-1<<endl; } if(p==3) { if(n==2) cout<<1<<endl; else cout<<-1<<endl; } if(p==4) cout<<-1<<endl; if(p==5) if(n==2) cout<<1<<endl; else cout<<-1<<endl; if(p==7) if(n==2) cout<<1<<endl; else cout<<-1<<endl; if(p!=1||p!=2||p!=3||p!=4||p!=5||p!=7) { cout<<"i donot understand"<<endl; } } }