-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathabc238_d.py
More file actions
30 lines (30 loc) · 768 Bytes
/
abc238_d.py
File metadata and controls
30 lines (30 loc) · 768 Bytes
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
###################################################
###################################################
###################################################
[AC]
t=int(input())
for _ in range(t):
a,s=map(int,input().split())
if s<2*a:
print("No")
continue
if (s-2*a)&a==0:
print("Yes")
else:
print("No")
###################################################
###################################################
[TLE]
t=int(input())
for _ in range(t):
a,s=map(int,input().split())
ans=0
for x in range(s+1):
y=s-x
if x & y ==a:
ans=1
break
print(['No','Yes'][ans])
###################################################
###################################################
###################################################