-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBRLADDER.cpp
53 lines (49 loc) · 984 Bytes
/
BRLADDER.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/*
@uthor: abhishekMadhu
handle: coder_nigga
UEM,KOLKATA
https://www.codechef.com/LTIME46/problems/BRLADDER
*/
#include <bits/stdc++.h>
#include <stdlib.h>
using namespace std;
typedef long long ll;
int main()
{
ll t,a,b,flag;
cin>>t;
// cout<<t;
while(t--)
{
// cout<<t;
flag=0;
cin>>a>>b;
if(a%2==0 && b%2==0)
{
if(abs(a-b)==2)
{
cout<<"YES\n";
flag=-1;
}
}
else if(a%2==1 && b%2==1)
{
if(abs(a-b)==2)
{
cout<<"YES\n";
flag=-1;
}
}
if((((a-1)/2)==((b-1)/2))||(((a-1)/2)==((b-1)/2)))
{
if(abs((a/2)-(b/2))==1)
{
cout<<"YES\n";
flag=-1;
}
}
if(flag==0)
cout<<"NO\n";
}
return 0;
}