Monocarp is playing a computer game. In this game, his character fights different monsters.

A fight between a character and a monster goes as follows. Suppose the character initially has health $h_C$ and attack $d_C$; the monster initially has health $h_M$ and attack $d_M$. The fight consists of several steps:

the character attacks the monster, decreasing the monster's health by $d_C$;

the monster attacks the character, decreasing the character's health by $d_M$;

the character attacks the monster, decreasing the monster's health by $d_C$;

the monster attacks the character, decreasing the character's health by $d_M$;

and so on, until the end of the fight.

The fight ends when someone's health becomes non-positive (i. e. $0$ or less). If the monster's health becomes non-positive, the character wins, otherwise the monster wins.

Monocarp's character currently has health equal to $h_C$ and attack equal to $d_C$. He wants to slay a monster with health equal to $h_M$ and attack equal to $d_M$. Before the fight, Monocarp can spend up to $k$ coins to upgrade his character's weapon and/or armor; each upgrade costs exactly one coin, each weapon upgrade increases the character's attack by $w$, and each armor upgrade increases the character's health by $a$.

Can Monocarp's character slay the monster if Monocarp spends coins on upgrades optimally?


-----Input-----

The first line contains one integer $t$ ($1 \le t \le 5 \cdot 10^4$) — the number of test cases. Each test case consists of three lines:

The first line contains two integers $h_C$ and $d_C$ ($1 \le h_C \le 10^{15}$; $1 \le d_C \le 10^9$) — the character's health and attack;

The second line contains two integers $h_M$ and $d_M$ ($1 \le h_M \le 10^{15}$; $1 \le d_M \le 10^9$) — the monster's health and attack;

The third line contains three integers $k$, $w$ and $a$ ($0 \le k \le 2 \cdot 10^5$; $0 \le w \le 10^4$; $0 \le a \le 10^{10}$) — the maximum number of coins that Monocarp can spend, the amount added to the character's attack with each weapon upgrade, and the amount added to the character's health with each armor upgrade, respectively.

The sum of $k$ over all test cases does not exceed $2 \cdot 10^5$.


-----Output-----

For each test case, print YES if it is possible to slay the monster by optimally choosing the upgrades. Otherwise, print NO.


-----Examples-----

Input
4
25 4
9 20
1 1 10
25 4
12 20
1 1 10
100 1
45 2
0 4 10
9 2
69 2
4 2 7
Output
YES
NO
YES
YES


-----Note-----

In the first example, Monocarp can spend one coin to upgrade weapon (damage will be equal to $5$), then health during battle will change as follows: $(h_C, h_M) = (25, 9) \rightarrow (25, 4) \rightarrow (5, 4) \rightarrow (5, -1)$. The battle ended with Monocarp's victory.

In the second example, Monocarp has no way to defeat the monster.

In the third example, Monocarp has no coins, so he can't buy upgrades. However, the initial characteristics are enough for Monocarp to win.

In the fourth example, Monocarp has $4$ coins. To defeat the monster, he has to spend $2$ coins to upgrade weapon and $2$ coins to upgrade armor.

Difficulty: EASY

Solutions:
import sys
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	f = 0
	(hc, dc) = map(int, input().split())
	(hm, dm) = map(int, input().split())
	(k, w, a) = map(int, input().split())
	for i in range(k + 1):
		h = hc + a * i
		d = dc + w * (k - i)
		c1 = (h + dm - 1) // dm
		c2 = (hm + d - 1) // d
		if c1 >= c2:
			f = 1
	print('YES' if f == 1 else 'NO')


import sys
import math
from bisect import bisect_right as br
from collections import deque
from itertools import combinations as cb

def int_arr():
	return list(map(int, sys.stdin.readline().strip().split()))

def str_arr():
	return list(map(str, sys.stdin.readline().strip().split()))

def input():
	return sys.stdin.readline().strip()
for _ in range(int(input())):
	(ch, cd) = int_arr()
	(mh, md) = int_arr()
	(k, w, a) = int_arr()
	for i in range(k + 1):
		atack = cd + w * i
		x = k - i
		hel = ch + a * x
		if mh // atack + min(1, mh % atack) <= hel // md + min(1, hel % md):
			print('YES')
			break
	else:
		print('NO')


import math
ans = ''
for _ in range(int(input())):
	(hc, dc) = list(map(int, input().split()))
	(hm, dm) = list(map(int, input().split()))
	(k, w, a) = list(map(int, input().split()))
	for i in range(k + 1):
		if math.ceil((hc + i * a) / dm) >= math.ceil(hm / (dc + w * (k - i))):
			ans += 'YES\n'
			break
	else:
		ans += 'NO\n'
print(ans)


import math
t = int(input())
ListA = []
for i in range(t):
	hc = input()
	(hc, ac) = [int(i) for i in hc.split(' ')]
	hm = input()
	(hm, am) = [int(i) for i in hm.split(' ')]
	k = input()
	(k, a, w) = [int(i) for i in k.split(' ')]
	diff = math.ceil(hm / ac) - math.ceil(hc / am)
	if diff > 0:
		count = 0
		for i in range(k + 1):
			attack = ac + i * a
			health = hc + (k - i) * w
			diff = math.ceil(hm / attack) - math.ceil(health / am)
			if diff <= 0:
				count += 1
				break
		if count == 1:
			ListA.append('YES')
		else:
			ListA.append('NO')
	else:
		ListA.append('YES')
for i in ListA:
	print(i)


ans = []
for _ in range(int(input())):
	character = input().split(' ')
	monster = input().split(' ')
	supplements = input().split(' ')
	coins = int(supplements[0])
	for i in range(coins + 1):
		charhealth = int(character[0])
		charattack = int(character[1])
		charhealth += i * int(supplements[2])
		charattack += (coins - i) * int(supplements[1])
		if (charhealth - 1) // int(monster[1]) >= (int(monster[0]) - 1) // charattack:
			ans.append('YES')
			break
	else:
		ans.append('NO')
for i in ans:
	print(i)


import sys
from math import ceil
input = sys.stdin.readline
MAX = sys.maxsize
sys.setrecursionlimit(10 ** 9)

def inp():
	return int(input())

def read_int_list():
	return list(map(int, input().split()))

def read_list():
	s = input()
	return list(s[:len(s) - 1])

def read_int_map():
	return map(int, input().split())

def compute_number_hits(dmg, armor):
	return int(ceil(armor / dmg))

def solve(hc, dc, hm, dm, coins, weapon, armor):
	die = compute_number_hits(dm, hc)
	hits = compute_number_hits(dc, hm)
	if hits <= die:
		return 'YES'
	for spent in range(coins):
		new_dc = dc + spent * weapon
		new_hc = hc + (coins - spent) * armor
		die = compute_number_hits(dm, new_hc)
		hits = compute_number_hits(new_dc, hm)
		if hits <= die:
			return 'YES'
		new_dc = dc + (coins - spent) * weapon
		new_hc = hc + spent * armor
		die = compute_number_hits(dm, new_hc)
		hits = compute_number_hits(new_dc, hm)
		if hits <= die:
			return 'YES'
	return 'NO'
for _ in range(inp()):
	(hc, dc) = read_int_list()
	(hm, dm) = read_int_list()
	(k, w, a) = read_int_list()
	print(solve(hc, dc, hm, dm, k, w, a))


def tList():
	a = map(int, input().split())
	return a
import math

def solve():
	for _ in range(int(input())):
		(hc, dc) = tList()
		(hm, dm) = tList()
		(k, m, a) = tList()
		for i in range(k + 1):
			h = hc + a * i
			d = dc + m * (k - i)
			r = [(hm + d - 1) // d, (h + dm - 1) // dm]
			if r[0] <= r[1]:
				print('YES')
				break
		else:
			print('NO')
solve()


t = int(input())
for _ in range(t):
	(hc, dc) = map(int, input().split())
	(hm, dm) = map(int, input().split())
	(k, w, a) = map(int, input().split())
	f = False
	for i in range(k + 1):
		udc = i * w + dc
		uhc = (k - i) * a + hc
		turns = (hm + udc - 1) // udc
		turns1 = (uhc + dm - 1) // dm
		if turns <= turns1:
			f = True
			break
	if f:
		print('YES')
	else:
		print('NO')


from math import ceil
for _ in range(int(input())):
	(hc, dc) = map(int, input().split())
	(hm, dm) = map(int, input().split())
	(k, w, a) = map(int, input().split())
	flag = 0
	for i in range(k + 1):
		hc1 = hc + i * a
		dc1 = dc + (k - i) * w
		step1 = ceil(hm / dc1)
		step2 = ceil(hc1 / dm)
		if step1 <= step2:
			flag = 1
			break
	if flag:
		print('YES')
	else:
		print('NO')


t = int(input())
for q in range(t):
	(H, D) = map(int, input().split())
	(h, d) = map(int, input().split())
	(k, w, a) = map(int, input().split())
	turns_p = (h + D - 1) // D
	turns_m = (H + d - 1) // d
	if turns_p <= turns_m:
		print('YES')
	else:
		flag = True
		for x in range(k + 1):
			y = k - x
			n = (h + (D + x * w) - 1) // (D + x * w)
			m = (H + y * a + d - 1) // d
			if n <= m:
				print('YES')
				flag = False
				break
		if flag:
			print('NO')


for _ in range(int(input())):
	(hc, dc) = map(int, input().split())
	(hm, dm) = map(int, input().split())
	(k, w, a) = map(int, input().split())
	b = 0
	for i in range(k + 1):
		x = (hm - 1) // (dc + w * i)
		y = (hc - 1 + a * (k - i)) // dm
		if x <= y:
			print('YES')
			b = 1
			break
	if b == 0:
		print('NO')


for i in range(int(input())):
	(hc, dc) = map(int, input().split())
	(hm, dm) = map(int, input().split())
	(k, w, a) = map(int, input().split())

	def battle(hc, dc, hm, dm, k, a, w):
		for i in range(0, k + 1):
			(hc1, dc1) = (hc + i * w, dc + (k - i) * a)
			h = -(-hm // dc1)
			m = -(-hc1 // dm)
			if m >= h:
				return 'YES'
		return 'NO'
	print(battle(hc, dc, hm, dm, k, w, a))


for _ in range(int(input())):
	(hc, dc) = map(int, input().split())
	(hm, dm) = map(int, input().split())
	(coin, weapon, armor) = map(int, input().split())
	flag = 0
	for i in range(coin + 1):
		tdc = dc + i * weapon
		thc = hc + (coin - i) * armor
		v1 = -(-hm // tdc)
		v2 = -(-thc // dm)
		if v1 <= v2:
			flag = 1
			break
	if flag == 1:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	(hc, dc) = map(int, input().split())
	(hm, dm) = map(int, input().split())
	(k, w, a) = map(int, input().split())
	res = 'NO'
	for i in range(k + 1):
		if ((hc + i * a - 1) // dm + 1) * (dc + (k - i) * w) >= hm:
			res = 'YES'
			break
	print(res)


t = int(input())
for i in range(t):
	s = 0
	(hc, dc) = map(int, input().split())
	(hm, dm) = map(int, input().split())
	(k, w, a) = map(int, input().split())
	if k == 0:
		if dc * -(-hc // dm) >= hm:
			print('YES')
			s = 1
			continue
		else:
			k = -1
	for j in range(k + 1):
		if (dc + (k - j) * w) * int((hc + j * a) / dm + 0.999) >= hm:
			print('YES')
			s = 1
			break
	if s == 0:
		print('NO')


t = int(input())
for _ in range(t):
	(hc, dc) = map(int, input().split())
	(hm, dm) = map(int, input().split())
	(k, w, a) = map(int, input().split())
	ans = 'NO'
	for i in range(k + 1):
		hcn = hc + i * a
		dcn = dc + (k - i) * w
		if (hm + dcn - 1) // dcn <= (hcn - 1 + dm) // dm:
			ans = 'YES'
			break
	print(ans)


def floorDiv(a, b):
	if a % b == 0:
		return a // b
	else:
		return a // b + 1
for T in range(int(input())):
	(h_c, d_c) = map(int, input().split(' '))
	(h_m, d_m) = map(int, input().split(' '))
	(k, a, w) = map(int, input().split(' '))
	d_c += a * k
	while k >= 0:
		if floorDiv(h_m, d_c) <= floorDiv(h_c, d_m):
			print('YES')
			break
		else:
			d_c -= a
			h_c += w
		k -= 1
	if k < 0:
		print('NO')


z = int(input())
from math import ceil
for i in range(z):
	(hc, dc) = map(int, input().split())
	(hm, dm) = map(int, input().split())
	(k, w, a) = map(int, input().split())
	p = ceil(hc / dm)
	m = ceil(hm / dc)
	if p >= m:
		print('YES')
	else:
		t = True
		for i in range(0, k + 1):
			if ceil((hc + i * a) / dm) >= ceil(hm / (dc + (k - i) * w)):
				t = False
				break
		if t == True:
			print('NO')
		else:
			print('YES')


t = int(input())
for _ in range(t):
	(hc, dc) = map(int, input().split())
	(hm, dm) = map(int, input().split())
	(k, w, a) = map(int, input().split())
	is_ans = False
	for i in range(k + 1):
		ndc = dc + i * w
		nhc = hc + (k - i) * a
		if (hm + ndc - 1) // ndc <= (nhc + dm - 1) // dm:
			is_ans = True
			break
	if is_ans:
		print('YES')
	else:
		print('NO')


from math import ceil
R = lambda : map(int, input().split())
for j in range(int(input())):
	(hc, dc) = R()
	(hm, dm) = R()
	(k, w, a) = R()
	for i in range(k + 1):
		if ceil(hm / (dc + (k - i) * w)) <= ceil((hc + i * a) / dm):
			print('YES')
			break
	else:
		print('NO')


import sys
import math

def get_ints():
	return map(int, sys.stdin.readline().strip().split())

def get_ls():
	return list(map(int, sys.stdin.readline().strip().split()))

def test_ok(ok):
	print('YES' if ok else 'NO')

def main():
	for _ in range(int(input())):
		(hc, dc) = map(int, input().split())
		(hm, dm) = map(int, input().split())
		(k, w, a) = map(int, input().split())
		ok = False
		for i in range(k + 1):
			new_hc = hc + i * a
			new_dc = dc + (k - i) * w
			x = hm // new_dc
			if hm % new_dc > 0:
				x += 1
			y = new_hc // dm
			if new_hc % dm > 0:
				y += 1
			if x <= y:
				ok = True
				break
		test_ok(ok)
main()


from sys import stdin
from math import ceil

def check(hc, hm, dc, dm, k, w, a):
	for i in range(k + 1):
		val1 = ceil((hc + (k - i) * a) / dm)
		val2 = ceil(hm / (dc + i * w))
		if val1 >= val2:
			return 'YES'
	return 'NO'
t = int(input())
for _ in range(t):
	(hc, dc) = map(int, input().split())
	(hm, dm) = map(int, input().split())
	(k, w, a) = map(int, input().split())
	print(check(hc, hm, dc, dm, k, w, a))


from math import ceil

def turns(attack, health):
	if health % attack == 0:
		return health // attack
	return ceil(health / attack)

def does_win(ha, hh, ma, mh):
	hturns = turns(ha, mh)
	mturns = turns(ma, hh)
	return hturns <= mturns

def can_spend(ha, hh, ma, mh, k, w, a):
	for wk in range(k + 1):
		if does_win(ha + wk * w, hh + (k - wk) * a, ma, mh):
			return True
	return False

def main():
	ncases = int(input())
	for i in range(ncases):
		(hh, ha) = input().split()
		(mh, ma) = input().split()
		(k, w, a) = input().split()
		if can_spend(int(ha), int(hh), int(ma), int(mh), int(k), int(w), int(a)):
			print('YES')
		else:
			print('NO')
main()


for _ in range(int(input())):
	(hc, dc) = [int(i) for i in input().split()]
	(hm, dm) = [int(i) for i in input().split()]
	(k, w, a) = [int(i) for i in input().split()]
	flag = 0
	for i in range(k + 1):
		if (hm - 1) // (dc + i * w) <= (hc + (k - i) * a - 1) // dm:
			flag = 1
			break
	if flag == 1:
		print('YES')
	else:
		print('NO')


t = int(input())
for _ in range(t):
	raw = input().split()
	(A, B) = (int(raw[0]), int(raw[1]))
	raw = input().split()
	(C, D) = (int(raw[0]), int(raw[1]))
	raw = input().split()
	(k, w, a) = (int(raw[0]), int(raw[1]), int(raw[2]))
	ok = False
	for i in range(k + 1):
		x = A + i * a
		y = B + (k - i) * w
		if (C + y - 1) // y <= (x + D - 1) // D:
			ok = True
			break
	print('YES' if ok else 'NO')


import math
T = int(input())
for i in range(T):
	(h_c, d_c) = map(int, input().split())
	(h_m, d_m) = map(int, input().split())
	(k, w, a) = map(int, input().split())
	for i in range(k + 1):
		if math.ceil(h_m / (d_c + (k - i) * w)) <= math.ceil((h_c + i * a) / d_m):
			print('YES')
			break
		elif i == k:
			print('NO')


t = int(input())
for T in range(t):
	(hc, dc) = [int(x) for x in input().split()]
	(hm, dm) = [int(x) for x in input().split()]
	(k, w, a) = [int(x) for x in input().split()]
	ans = 'NO'
	k1 = k
	while k1 >= 0:
		hc1 = hc + (k - k1) * a
		dc1 = dc + k1 * w
		ce = hc1 // dm
		if hc1 % dm != 0:
			ce += 1
		me = hm // dc1
		if hm % dc1 != 0:
			me += 1
		if ce >= me:
			ans = 'YES'
			break
		k1 -= 1
	print(ans)


import math
for t in range(int(input())):
	(ch, cd) = map(int, input().split())
	(mh, md) = map(int, input().split())
	(k, a, d) = map(int, input().split())
	flag = False
	for i in range(k + 1):
		rounds = math.ceil((i * d + ch) / md)
		atk = cd + (k - i) * a
		if rounds * atk >= mh:
			print('YES')
			flag = True
			break
	if not flag:
		print('NO')


from math import ceil
for _ in range(int(input())):
	(hc, dc) = map(int, input().split())
	(hm, dm) = map(int, input().split())
	(k, w, a) = map(int, input().split())
	ans = 'NO'
	for i in range(0, k + 1):
		chr = ceil((hc + (k - i) * a) / dm)
		mon = ceil(hm / (dc + i * w))
		if chr >= mon:
			ans = 'YES'
			break
	print(ans)