import itertools
import heapq
import collections
import math
import sys
input = sys.stdin.readline
def inp():
return (int(input()))
def inlt():
return (list(map(int, input().split())))
def insr():
s = input()
return (list(s[:len(s) - 1]))
def invr():
return (map(int, input().split()))
def inis():
return (input().split())
def stlt():
return list(map(str, input().split()))
def SieveOfEratosthenes(n):
prime = [True for i in range(n+1)]
p = 2
l = []
while (p * p <= n):
if (prime[p] == True):
for i in range(p * p, n+1, p):
prime[i] = False
p += 1
for p in range(2, n+1):
if prime[p]:
l.append(p)
else:
continue
return l
def isPrime(n):
prime_flag = 0
if n > 1:
for i in range(2, int(math.sqrt(n)) + 1):
if n % i == 0:
prime_flag = 1
break
if prime_flag == 0:
return True
else:
return False
else:
return False
def gcdofarray(a):
x = 0
for p in a:
x = math.gcd(x, p)
return x
def printDivisors(n):
i = 1
ans = []
while i <= math.sqrt(n):
if (n % i == 0):
if (n / i == i):
ans.append(i)
else:
ans.append(i)
ans.append(n // i)
i = i + 1
ans.sort()
return ans
def CountDivisors(n):
i = 1
ans = []
while i <= math.sqrt(n):
if (n % i == 0):
if (n / i == i):
ans.append(i)
else:
ans.append(i)
ans.append(n // i)
i = i + 1
ans.sort()
return len(ans)
def binaryToDecimal(n):
return int(n, 2)
def countTriplets(a, n):
s = set()
for i in range(n):
s.add(a[i])
count = 0
for i in range(n):
for j in range(i + 1, n, 1):
xr = a[i] ^ a[j]
if xr in s and xr != a[i] and xr != a[j]:
count += 1
return int(count // 3)
def generate_twin_prime(n):
a = 0
for i in range(1, n + 1):
j = i + 2
if isPrime(i) and isPrime(j):
if 2 ^ (i ^ j) == 0:
a += 1
return a
def smallestDivisor(n):
if (n % 2 == 0):
return 2
i = 3
while (i * i <= n):
if (n % i == 0):
return i
i += 2
return n
def countOdd(L, R):
N = (R - L) // 2
if (R % 2 != 0 or L % 2 != 0):
N += 1
return N
def isPalindrome(s):
return s == s[::-1]
def sufsum(test_list):
test_list.reverse()
res = [sum(test_list[: i + 1]) for i in range(len(test_list))]
return res
def prsum(lst):
return (list(itertools.accumulate(lst)))
def badachotabadachota(nums):
nums.sort()
i = 0
j = len(nums) - 1
ans = []
cc = 0
while len(ans) != len(nums):
if cc % 2 == 0:
ans.append(nums[j])
j -= 1
else:
ans.append(nums[i])
i += 1
cc += 1
return ans
def primeFactors(n):
ans = []
while n % 2 == 0:
ans.append(2)
n = n // 2
for i in range(3, int(math.sqrt(n))+1, 2):
while n % i == 0:
ans.append(i)
n = n / i
if n > 2:
ans.append(n)
return ans
def closestMultiple(n, x):
if x > n:
return x
z = (int)(x / 2)
n = n + z
n = n - (n % x)
return n
def can_form_palindrome(arr, n):
MAX = 256
s = ""
for i in range(n):
s = s + str(arr[i])
freq = [0]*MAX
for i in range(n):
freq[arr[i]] = freq[arr[i]]+1
count = 0
for i in range(MAX):
if (freq[i] & 1):
count = count+1
if (count > 1):
return False
return True
def getPairsCount(arr, n, sum):
m = [0] * 1000
for i in range(0, n):
m[arr[i]] += 1
twice_count = 0
for i in range(0, n):
twice_count += m[int(sum - arr[i])]
if (int(sum - arr[i]) == arr[i]):
twice_count -= 1
return int(twice_count / 2)
def remove_consec_duplicates(test_list):
res = [i[0] for i in itertools.groupby(test_list)]
return res
def BigPower(a, b, mod):
if b == 0:
return 1
ans = BigPower(a, b//2, mod)
ans *= ans
ans %= mod
if b % 2:
ans *= a
return ans % mod
alphabets = list("abcdefghijklmnopqrstuvwxyz")
def check(r,g,b,w):
return False if r%2 + g%2 + b%2 + w%2 > 1 else True
if __name__ == '__main__':
T = int(input())
for ttt in range(T):
r,g,b,w = map(int,input().split())
if check(r,g,b,w):
print("Yes")
elif r>0 and g>0 and b>0 and check(r-1,g-1,b-1,w+1):
print("Yes")
else :
print("No")
#include <bits/stdc++.h>
#define S 400000
#define sc second
#define fr first
#define pb push_back
#define pf push_front
#define frn front
#define bc back
#define en endl
#define sst stringstream
#define sz(x) (x).size()
#define rev(x) reverse((x).begin(),(x).end())
typedef long long ll;
typedef unsigned long long ull;
typedef double db;
typedef long double ld;
using namespace std;
const int inf=2147483647;
const int ninf=-inf;
const int z4=1e4+5;
const int z5=1e5+5;
const int z6=1e6+5;
const int mod=1000000007;
string al="abcdefghijklmnopqrstuvwxyz";
string AL="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
bool con(int a,int b,int c,int d){
int cnt=0;
if(a&1) cnt++;
if(b&1) cnt++;
if(c&1) cnt++;
if(d&1) cnt++;
if(cnt==0||cnt==1){
return true;
}
else if(cnt==3||cnt==4){
if(min(a,min(b,c))>=1) return true;
}
return false;
}
signed main () {
ios_base::sync_with_stdio (false);
cin.tie (0);
cout.tie (0);
// freopen("sum.in","r",stdin);
// freopen("sum.out","w",stdout);
int q;
cin>>q;
while(q--){
int r,g,b,w;
cin>>r>>g>>b>>w;
bool f=con(r,g,b,w);
cout<<(f?"Yes":"No")<<en;
}
return 0;
}
1002. Find Common Characters | 1602A - Two Subsequences |
1555A - PizzaForces | 1607B - Odd Grasshopper |
1084A - The Fair Nut and Elevator | 1440B - Sum of Medians |
1032A - Kitchen Utensils | 1501B - Napoleon Cake |
1584B - Coloring Rectangles | 1562B - Scenes From a Memory |
1521A - Nastia and Nearly Good Numbers | 208. Implement Trie |
1605B - Reverse Sort | 1607C - Minimum Extraction |
1604B - XOR Specia-LIS-t | 1606B - Update Files |
1598B - Groups | 1602B - Divine Array |
1594B - Special Numbers | 1614A - Divan and a Store |
2085. Count Common Words With One Occurrence | 2089. Find Target Indices After Sorting Array |
2090. K Radius Subarray Averages | 2091. Removing Minimum and Maximum From Array |
6. Zigzag Conversion | 1612B - Special Permutation |
1481. Least Number of Unique Integers after K Removals | 1035. Uncrossed Lines |
328. Odd Even Linked List | 1219. Path with Maximum Gold |