Chef recently started working at ABC corporation. Let's number weekdays (Monday through Friday) by integers $1$ through $5$. For each valid $i$, the number of hours Chef spent working at the office on weekday $i$ was $A_i$.
Unfortunately, due to the COVID-19 pandemic, Chef started working from home and his productivity decreased by a considerable amount. As per Chef's analysis, $1$ hour of work done at the office is equivalent to $P$ hours of work done at home.
Now, in order to complete his work properly, Chef has to spend more hours working from home, possibly at the cost of other things like sleep. However, he does not have to do the same work on each day as he would have in the office ― for each weekday, he can start the work for this day on an earlier day and/or complete it on a later day. The only requirement is that his work does not pile up indefinitely, i.e. he can complete his work for each week during the same week. One day has $24$ hours.
If Chef is unable to complete his work for a week during those five weekdays, then he has to work during the weekend too. Chef wishes to know whether he has to work on weekends or if he can complete his work by working only on weekdays. Help him answer that question. (It is possible that Chef would be unable to finish his work even if he worked all the time, but he does not want to know about that.)

-----Input-----
- The first line of the input contains a single integer $T$ denoting the number of test cases. The description of $T$ test cases follows.
- The first and only line of each test case contains six space-separated integers $A_1$, $A_2$, $A_3$, $A_4$, $A_5$ and $P$.

-----Output-----
For each test case, print a single line containing the string "Yes" if Chef has to work on weekends or "No" otherwise (without quotes).

-----Constraints-----
- $1 \le T \le 1,000$
- $0 \le A_i \le 24$ for each valid $i$
- $1 \le P \le 24$

-----Subtasks-----
Subtask #1 (100 points): original constraints

-----Example Input-----
2
14 10 12 6 18 2
10 10 10 10 10 3

-----Example Output-----
No
Yes

-----Explanation-----
Example case 1: Here, $P=2$, so the number of hours Chef has to work from home to handle his workload for days $1$ through $5$ is $[28,20,24,12,36]$. If he works for full $24$ hours on each of the five weekdays, he finishes all the work, so he does not have to work on weekends.
Example case 2: No matter what Chef does, he will have to work on weekends.

Difficulty: EASY
Tags: Mathematics

Starter code:

Solutions:
for i in range(int(input())):
	lst1 = list(map(int, input().split()))
	p = lst1.pop()
	if sum(lst1) * p <= 120:
		print('No')
	else:
		print('Yes')


T = int(input())
for i in range(T):
	L = list(map(int, input().split()))
	P = L[-1]
	L.remove(P)
	for j in range(len(L)):
		L[j] = L[j] * P
	S = sum(L)
	if S > 120:
		print('Yes')
	else:
		print('No')


for _ in range(int(input())):
	a = list(map(int, input().split()))
	p = a[len(a) - 1]
	b = sum(a) - p
	if b * p - 120 > 0:
		print('Yes')
	else:
		print('No')


for _ in range(int(input())):
	(a, b, c, d, e, p) = map(int, input().split())
	if p * (a + b + c + d + e) <= 5 * 24:
		print('No')
	else:
		print('Yes')


for _ in range(int(input())):
	l = list(map(int, input().split()))
	l = (sum(l) - l[5]) * l[5]
	if l <= 24 * 5:
		print('No')
	else:
		print('Yes')


T = int(input())
for i in range(T):
	(A1, A2, A3, A4, A5, P) = list(map(int, input().split()))
	sum = (A1 + A2 + A3 + A4 + A5) * P
	if sum > 120:
		print('Yes')
	else:
		print('No')


t = int(input())
for z in range(t):
	a = [int(x) for x in input().split()]
	p = a[-1]
	a = a[:-1]
	s = 0
	for i in a:
		s += i * p
	if s > 120:
		print('Yes')
	else:
		print('No')


for i in range(int(input())):
	l = list(map(int, input().split()))
	p = l[-1]
	l.pop()
	for i in range(len(l)):
		l[i] = l[i] * p
	k = len(l) * 24
	k1 = sum(l)
	if k1 > k:
		print('Yes')
	else:
		print('No')


cases = int(input())
for _ in range(cases):
	(a1, a2, a3, a4, a5, p) = map(int, input().split())
	x = a1 + a2 + a3 + a4 + a5
	if x * p <= 120:
		print('No')
	else:
		print('Yes')


t = int(input())
for i in range(t):
	(a, b, c, d, e, f) = map(int, input().split())
	n = a + b + c + d + e
	m = n * f
	if m <= 120:
		print('No')
	else:
		print('Yes')


x = int(input())
for i in range(x):
	(a, b, c, d, e, p) = map(int, input().split())
	s = a + b + c + d + e
	z = s * p
	if z <= 120:
		print('No')
	else:
		print('Yes')


for i in range(int(input())):
	(a1, a2, a3, a4, a5, p) = list(map(int, input().split()))
	x = a1 + a2 + a3 + a4 + a5
	sum = x * p
	if sum <= 120:
		print('No')
	else:
		print('Yes')


t = int(input())
for _ in range(t):
	(a1, a2, a3, a4, a5, p) = map(int, input().split())
	if (a1 + a2 + a3 + a4 + a5) * p <= 24 * 5:
		print('No')
	else:
		print('Yes')


for i in range(int(input())):
	l = list(map(int, input().split(' ')))
	k = []
	for i in range(len(l) - 1):
		k.append(l[i] * l[len(l) - 1])
	n = sum(k)
	if n <= 120:
		print('No')
	else:
		print('Yes')


for i in range(int(input())):
	l = list(map(int, input().split()))
	p = l.pop()
	mul = [i * p for i in l]
	total = sum(mul)
	if total > 5 * 24:
		print('Yes')
	else:
		print('No')


for _ in range(int(input())):
	l = list(map(int, input().split()))
	m = l.pop(5)
	sum = 0
	for i in range(len(l)):
		l[i] = l[i] * m
		sum += l[i]
	if sum <= 120:
		print('No')
	else:
		print('Yes')


for i in range(int(input())):
	n = list(map(int, input().split()))
	p = sum(n) - n[-1]
	if p * n[-1] > 5 * 24:
		print('Yes')
	else:
		print('No')


for __ in range(int(input())):
	val = list(map(int, input().split()))
	s = 0
	for i in range(0, len(val) - 1):
		s += val[i] * val[-1]
	if s <= 24 * 5:
		print('No')
	else:
		print('Yes')


t = int(input())
for i in range(t):
	count = 0
	a = list(map(int, input().split()))
	for i in range(len(a) - 1):
		count += a[i] * a[len(a) - 1]
	if count > 120:
		print('Yes')
	else:
		print('No')


t = int(input())
while t:
	(A1, A2, A3, A4, A5, P) = map(int, input().split())
	s = (A1 + A2 + A3 + A4 + A5) * P
	C = 'No'
	if s > 120:
		C = 'Yes'
	print(C)
	t = t - 1


for i in range(int(input())):
	(*a, p) = [int(n) for n in input().split()]
	for it in range(len(a)):
		a[it] = a[it] * p
	print('Yes' if sum(a) > 120 else 'No')


t = int(input())
for x in range(t):
	a = [int(c) for c in input().split()]
	p = a.pop()
	S = sum(a) * p
	if S <= 120:
		print('No')
	else:
		print('Yes')


for i in range(int(input())):
	x = list(map(int, input().split()))
	v = 5 * 24
	n = x[-1]
	m = 0
	for i in x[:5]:
		m = m + i * n
	if m <= v:
		print('No')
	else:
		print('Yes')


T = int(input())
for i in range(T):
	(A1, A2, A3, A4, A5, P) = map(int, input().split())
	rumah = A1 + A2 + A3 + A4 + A5
	kantor = P * rumah
	if kantor <= 120:
		print('No')
	else:
		print('Yes')


for _ in range(int(input())):
	arr = list(map(int, input().split()))
	n = len(arr)
	s = 0
	for i in range(n - 1):
		s += arr[i]
	p = s * arr[n - 1]
	if p <= 120:
		print('No')
	else:
		print('Yes')


t = int(input())
for i in range(t):
	x = list(input().split())
	a1 = int(x[0])
	a2 = int(x[1])
	a3 = int(x[2])
	a4 = int(x[3])
	a5 = int(x[4])
	p = int(x[5])
	a = int(p * (a1 + a2 + a3 + a4 + a5))
	if a <= 120:
		print('No')
	else:
		print('Yes')


t = int(input())
for i in range(t):
	l = list(map(int, input().split()))
	p = l[5]
	sum = 0
	for i in range(5):
		l[i] = l[i] * p
		sum += l[i]
	if sum <= 120:
		print('No')
	else:
		print('Yes')


for i in range(int(input())):
	x = list(map(int, input().split()))
	e = x[-1]
	del x[-1]
	res = [p * e for p in x]
	if sum(res) <= 120:
		print('No')
	else:
		print('Yes')


t = int(input())
for i in range(t):
	c = []
	l = list(map(int, input().split()))
	a = l[0:len(l) - 1]
	d = l[-1]
	for i in a:
		c.append(i * d)
	s = sum(c)
	if s <= 120:
		print('No')
	else:
		print('Yes')


t = int(input())
while t > 0:
	l = list(map(int, input().split()))
	p = l[-1]
	l.pop()
	for i in range(len(l)):
		l[i] = p * l[i]
	if sum(l) <= 120:
		print('No')
	else:
		print('Yes')
	t = t - 1


t = int(input())
for i in range(t):
	(a1, a2, a3, a4, a5, p) = list(map(int, input().split()))
	c = a1 * p + a2 * p + a3 * p + a4 * p + a5 * p
	if c <= 120:
		print('No')
	else:
		print('Yes')


for t in range(int(input())):
	(a, b, c, d, e, p) = map(int, input().split())
	tot = a + b + c + d + e
	s = p * tot
	if s <= 120:
		print('No')
		pass
	else:
		print('Yes')
		pass
	pass


for _ in range(int(input())):
	(a, b, c, d, e, p) = map(int, input().split())
	s = a + b + c + d + e
	s = s * p
	if s > 120:
		print('Yes')
	else:
		print('No')


n = int(input())
for i in range(n):
	lis = list(map(int, input().split()))
	print('Yes' if sum(lis[:5]) * lis[5] > 120 else 'No')


n = int(input())
while n:
	l = list(map(int, input().split()))
	s = 0
	for i in range(5):
		s += l[i] * l[5]
	if s / 24 > 5:
		print('Yes')
	else:
		print('No')
	n -= 1


for _ in range(int(input())):
	arr = list(map(int, input().split()))
	summ = sum(arr[:-1])
	if arr[-1] * summ > 120:
		print('Yes')
	else:
		print('No')


for r in range(int(input())):
	x = list(map(int, input().split()))
	p = x.pop(len(x) - 1)
	x = [i * p for i in x]
	if sum(x) > 24 * 5:
		print('Yes')
	else:
		print('No')


for i in range(int(input())):
	l = list(map(int, input().split()))
	v = len(l) - 1
	p = l[v]
	s = 0
	l.remove(p)
	for i in l:
		s = s + i * p
	if s <= 120:
		print('No')
	else:
		print('Yes')


T = int(input())
for i in range(T):
	(A1, A2, A3, A4, A5, P) = map(int, input().split())
	A = [A1 * P, A2 * P, A3 * P, A4 * P, A5 * P]
	sum1 = sum(A)
	if sum1 / 24 <= 5:
		print('No')
	else:
		print('Yes')


for i in range(0, int(input())):
	list1 = list(map(int, input().split()))
	for i in range(0, len(list1) - 1):
		list1[i] = list1[i] * list1[-1]
	a = sum(list1) - list1[-1]
	if a <= 24 * 5:
		print('No')
	else:
		print('Yes')


for i in range(int(input())):
	L = input().split()
	l = [eval(i) for i in L]
	k = l[-1]
	work_hours = 0
	for i in range(len(l) - 1):
		work_hours += l[i] * k
	if work_hours > 120:
		print('Yes')
	else:
		print('No')


for _ in range(int(input())):
	a = list(map(int, input().split()))
	l = []
	for i in range(len(a) - 1):
		l.append(a[i] * a[5])
	if 120 >= sum(l):
		print('No')
	else:
		print('Yes')


for T in range(int(input())):
	(A1, A2, A3, A4, A5, P) = tuple(map(int, input().split()))
	R = (A1 + A2 + A3 + A4 + A5) * P
	if R > 120:
		print('Yes')
	else:
		print('No')


for i in range(int(input())):
	l = list(map(int, input().split()))
	lnd = 24 * 5
	cht = (sum(l) - l[-1]) * l[-1] - lnd
	if cht <= 0:
		print('No')
	else:
		print('Yes')


t = int(input())
for i in range(t):
	a = list(map(int, input().split()))
	p = a[-1]
	a = a[:-1]
	h = [p * j for j in a]
	tot = 0
	for j in h:
		tot += j
	if tot / 5 <= 24:
		print('No')
	else:
		print('Yes')


for i in range(int(input())):
	q = input().split()
	g = [eval(x) for x in q]
	p = g[-1]
	wh = 0
	for x in range(len(g) - 1):
		wh += g[x] * p
	if wh > 120:
		print('Yes')
	else:
		print('No')


for i in range(int(input())):
	n = [int(x) for x in input().split()]
	t = n[-1]
	n = n[:-1]
	a = 0
	for i in n:
		a += i * t
	if a > 120:
		print('Yes')
	else:
		print('No')


for t in range(int(input())):
	(a1, a2, a3, a4, a5, p) = [int(x) for x in input().rstrip().split()]
	if (a1 + a2 + a3 + a4 + a5) * p > 120:
		print('Yes')
	else:
		print('No')


for _ in range(int(input())):
	A = list(map(int, input().split()))
	p = A[5]
	del A[5]
	if 24 * 5 < p * sum(A):
		print('Yes')
	else:
		print('No')


for i in range(int(input())):
	(a, b, c, d, e, f) = map(int, input().split())
	s = (a + b + c + d + e) * f
	h = 24 * 5
	if s > h:
		print('Yes')
	else:
		print('No')


for i in range(int(input())):
	a = [int(j) for j in input().split()]
	a = [k * a[5] for k in a]
	a.pop()
	if sum(a) > 120:
		print('Yes')
	else:
		print('No')


t = int(input())
for _ in range(t):
	(a, b, c, d, e, f) = map(int, input().split())
	x = a + b + c + d + e
	y = x * f
	if y <= 120:
		print('No')
	else:
		print('Yes')


for _ in range(int(input())):
	arr = list(map(int, input().split()))
	p = arr[5]
	arr = arr[:5]
	if sum(list(map(lambda x: x * p, arr))) > 120:
		print('Yes')
	else:
		print('No')


for _ in range(int(input())):
	list1 = map(int, input().split())
	list1 = list(list1)
	list1_1 = []
	list2 = []
	for i in range(5):
		list1_1.append(list1[i])
		list2.append(list1[i] * list1[-1])
	sumi1 = sum(list1_1)
	sumi2 = sum(list2)
	sumi3 = 24 * 5
	if sumi3 - sumi2 >= 0:
		print('No')
	else:
		print('Yes')


for _ in range(int(input())):
	l = list(map(int, input().split()))
	l1 = l[:5]
	p = l[5:]
	my_new_list = [i * p[0] for i in l1]
	if sum(my_new_list) <= 24 * 5:
		print('No')
	else:
		print('Yes')


for x in range(0, int(input())):
	array = list(map(int, input().split()))
	sum1 = 0
	for x in range(0, len(array) - 1):
		sum1 += array[x] * array[-1]
	if sum1 <= 120:
		print('No')
	else:
		print('Yes')


t = int(input())
for i in range(t):
	(a, b, c, d, e, p) = map(int, input().split(' '))
	work = a + b + c + d + e
	office_work = p * work
	if office_work <= 120:
		print('No')
	else:
		print('Yes')


for _ in range(int(input())):
	a = list(map(int, input().split()))
	p = a[-1]
	a = a[:-1]
	for i in range(len(a)):
		a[i] = a[i] * p
	b = sum(a)
	if b > 24 * 5:
		print('Yes')
	else:
		print('No')


t = int(input())
for bunny in range(t):
	(a1, a2, a3, a4, a5, p) = map(int, input().split())
	b = a1 + a2 + a3 + a4 + a5
	b = b * p
	if b > 120:
		print('Yes')
	else:
		print('No')


T = int(input())
for i in range(T):
	(A, B, C, D, E, P) = map(int, input().split())
	X = A + B + C + D + E
	S = X * P
	if S <= 120:
		print('No')
	else:
		print('Yes')


for i in range(int(input())):
	numberlist = list(map(int, input().split()))
	timelist = numberlist[:-1]
	p = numberlist[-1]
	for i in range(len(timelist)):
		timelist[i] *= p
	if sum(timelist) <= 120:
		print('No')
	else:
		print('Yes')


for _ in range(int(input())):
	l = list(map(int, input().split()))
	k1 = 24 * 5
	k2 = 0
	for i in range(len(l) - 1):
		x = l[i] * l[-1]
		k2 = k2 + x
	if k2 <= k1:
		print('No')
	else:
		print('Yes')


for _ in range(int(input())):
	arr1 = [int(x) for x in input().split()]
	p = arr1[-1]
	arr1.pop(-1)
	sum1 = 0
	for y in arr1:
		sum1 += y
	t_h = sum1 * p
	if t_h > 120:
		print('Yes')
	else:
		print('No')


for _ in range(int(input())):
	a = [int(i) for i in input().split()]
	p = a[-1]
	b = [p * i for i in a[:-1]]
	if sum(b) <= 120:
		print('No')
	else:
		print('Yes')


for _ in range(int(input())):
	list1 = list(map(int, input().split()))
	mul = list1[5]
	list1.remove(mul)
	time = sum(list(map(lambda x: x * mul, list1)))
	if time <= 120:
		print('No')
	else:
		print('Yes')


for i in range(int(input())):
	A = list(map(int, input().split()))
	x = A[5]
	s = 0
	for i in range(5):
		s = s + A[i] * x
	if s > 24 * 5:
		print('Yes')
	else:
		print('No')


for _ in range(int(input())):
	lista = list(map(int, input().split()))
	new_list = []
	for i in range(len(lista) - 1):
		new_list.append(lista[i] * lista[-1])
	if sum(new_list) <= 120:
		print('No')
	else:
		print('Yes')


t = int(input())
for _ in range(t):
	l = list(map(int, input().split()))
	p = l.pop()
	l = [i * p for i in l]
	if sum(l) <= 120:
		print('No')
	else:
		print('Yes')


cases = int(input())
for i in range(cases):
	(a, b, c, d, e, f) = map(int, input().split())
	a = a * f
	b = b * f
	c = c * f
	d = d * f
	e = e * f
	if a + b + c + d + e > 120:
		print('Yes')
	else:
		print('No')


t = int(input())
for i in range(t):
	(a, b, c, d, e, k) = map(int, input().split())
	x = a + b + c + d + e
	x = x * k
	if x <= 120:
		print('No')
	else:
		print('Yes')


for _ in range(int(input())):
	x = list(map(int, input().split()))
	List = []
	p = x[-1]
	for i in (x[0], x[1], x[2], x[3], x[4]):
		List.append(i * p)
	print('Yes' if sum(List) > 120 else 'No')


for T in range(int(input())):
	lst = list(map(int, input().split()))
	p = lst[-1]
	a = lst[:5]
	totalH = 0
	for x in a:
		totalH += x * p
	if totalH > 24 * 5:
		print('Yes')
	else:
		print('No')


for _ in range(int(input())):
	(s, m, t, w, th, f) = map(int, input().split())
	p = s + m + t + w + th
	a = p * f
	if a <= 120:
		print('No')
	else:
		print('Yes')


n = int(input())
for _ in range(n):
	l = list(map(int, input().split()))
	p = l.pop()
	s = sum(l) * p
	if s / 24 > 5:
		print('Yes')
	else:
		print('No')


t = int(input())
while t > 0:
	a = list(map(int, input().split()))
	total_hours = 5 * 24
	p = a[len(a) - 1]
	sum = 0
	a.remove(p)
	for i in a:
		sum = sum + p * i
	if sum > total_hours:
		print('Yes')
	elif sum <= total_hours:
		print('No')
	t -= 1


for _ in range(int(input())):
	(A, B, C, D, E, P) = map(int, input().split())
	max_hrs = 24 * 5
	chef_hrs = (A + B + C + D + E) * P
	if chef_hrs <= max_hrs:
		print('No')
	else:
		print('Yes')


t = int(input())
for _ in range(t):
	l = list(map(int, input().split()))
	val = sum(l[:len(l) - 1]) * l[-1]
	if val <= 120:
		print('No')
	else:
		print('Yes')


for o in range(int(input())):
	l = list(map(int, input().split()))
	s = sum(l) - l[-1]
	if s * l[-1] <= 120:
		print('No')
	else:
		print('Yes')


for i in range(int(input())):
	(a, b, c, d, e, f) = map(int, input().split())
	x = a * f + b * f + c * f + d * f + e * f
	y = 24 * 5
	if x <= y:
		print('No')
	else:
		print('Yes')


for _ in range(int(input())):
	l1 = list(map(int, input().split()))
	x = l1.pop()
	l1 = l1 * x
	if sum(l1) <= 120:
		print('No')
	else:
		print('Yes')


for i in range(int(input())):
	x = input().split()
	th = 5 * 24
	(s, m) = (0, int(x[-1]))
	for i in range(5):
		n = int(x[i])
		s += n * m
	if s > th:
		print('Yes')
	else:
		print('No')