Being tired of participating in too many Codeforces rounds, Gildong decided to take some rest in a park. He sat down on a bench, and soon he found two rabbits hopping around. One of the rabbits was taller than the other.

He noticed that the two rabbits were hopping towards each other. The positions of the two rabbits can be represented as integer coordinates on a horizontal line. The taller rabbit is currently on position $x$, and the shorter rabbit is currently on position $y$ ($x \lt y$). Every second, each rabbit hops to another position. The taller rabbit hops to the positive direction by $a$, and the shorter rabbit hops to the negative direction by $b$.

 [Image] 

For example, let's say $x=0$, $y=10$, $a=2$, and $b=3$. At the $1$-st second, each rabbit will be at position $2$ and $7$. At the $2$-nd second, both rabbits will be at position $4$.

Gildong is now wondering: Will the two rabbits be at the same position at the same moment? If so, how long will it take? Let's find a moment in time (in seconds) after which the rabbits will be at the same point.


-----Input-----

Each test contains one or more test cases. The first line contains the number of test cases $t$ ($1 \le t \le 1000$).

Each test case contains exactly one line. The line consists of four integers $x$, $y$, $a$, $b$ ($0 \le x \lt y \le 10^9$, $1 \le a,b \le 10^9$) — the current position of the taller rabbit, the current position of the shorter rabbit, the hopping distance of the taller rabbit, and the hopping distance of the shorter rabbit, respectively.


-----Output-----

For each test case, print the single integer: number of seconds the two rabbits will take to be at the same position.

If the two rabbits will never be at the same position simultaneously, print $-1$.


-----Example-----
Input
5
0 10 2 3
0 10 3 3
900000000 1000000000 1 9999999
1 2 1 1
1 3 1 1

Output
2
-1
10
-1
1



-----Note-----

The first case is explained in the description.

In the second case, each rabbit will be at position $3$ and $7$ respectively at the $1$-st second. But in the $2$-nd second they will be at $6$ and $4$ respectively, and we can see that they will never be at the same position since the distance between the two rabbits will only increase afterward.

Difficulty: EASY

Solutions:
def main():
	for _ in range(int(input())):
		(x, y, a, b) = map(int, input().split())
		print((y - x) // (a + b) if (y - x) % (a + b) == 0 else -1)
main()


trial = int(input())
for i in range(trial):
	variable = list(map(int, input().split()))
	x = variable[0]
	y = variable[1]
	a = variable[2]
	b = variable[3]
	distance = y - x
	speed = a + b
	num = 0
	if distance % speed == 0:
		print(distance // speed)
	else:
		print(-1)


for i in range(int(input())):
	(x, y, a, b) = map(int, input().split())
	c = (y - x) / (a + b)
	c = int(c)
	if (y - x) % (a + b) == 0:
		print(c)
	else:
		print(-1)


for _mind_control in range(int(input())):
	(x, y, a, b) = map(int, input().split())
	if abs(y - x) % (a + b) == 0:
		print(abs(y - x) // (a + b))
	else:
		print(-1)


t = int(input())
for i in range(t):
	(x, y, a, b) = [int(n) for n in input().split()]
	if (y - x) % (a + b) == 0:
		print(int((y - x) / (a + b)))
	else:
		print('-1')


t = int(input())
ans = []
for x in range(0, t):
	(x, y, a, b) = map(int, input().split())
	if abs(x - y) % (a + b) == 0:
		ans.append(abs(x - y) // (a + b))
	else:
		ans.append(-1)
for f in range(0, t):
	print(ans[f])


import os
import sys
from io import BytesIO, IOBase
import math
from decimal import Decimal
from decimal import *
from collections import defaultdict, deque
import heapq
from decimal import Decimal
getcontext().prec = 25
abcd = 'abcdefghijklmnopqrstuvwxyz'
MOD = pow(10, 9) + 7
BUFSIZE = 8192
from bisect import bisect_left, bisect_right

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
for _ in range(int(input())):
	(x, y, a, b) = map(int, input().split(' '))
	if (y - x) % (a + b):
		print(-1)
	else:
		print((y - x) // (a + b))


n = int(input())

def f():
	(x, y, a, b) = map(int, input().split())
	c = y - x
	if c % (a + b) == 0:
		print(c // (a + b))
	else:
		print(-1)
for x in range(n):
	f()


t = input()

def lol(x, y, a, b):
	k = (y - x) / (a + b)
	if int(k) == float(k):
		return int(k)
	else:
		return -1
for i in range(int(t)):
	data = input()
	x = int(data.split()[0])
	y = int(data.split()[1])
	a = int(data.split()[2])
	b = int(data.split()[3])
	print(lol(x, y, a, b))


t = int(input())
while t:
	t -= 1
	(x, y, a, b) = map(int, input().split())
	if (y - x) % (a + b):
		print(-1)
	else:
		print((y - x) // (a + b))


for _ in range(int(input())):
	(x, y, a, b) = map(int, input().split())
	ans = -1
	d = y - x
	z = d / (a + b)
	if z == int(z):
		ans = int(z)
	print(ans)


import os
import heapq
import sys
import math
import operator
from collections import defaultdict
from io import BytesIO, IOBase

def inar():
	return [int(k) for k in input().split()]

def main():
	for i in range(int(input())):
		(x, y, a, b) = inar()
		dif = y - x
		if dif < 0 or dif % (a + b) != 0:
			print('-1')
		else:
			print(dif // (a + b))
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


t = int(input())
for i in range(t):
	(a, b, c, d) = map(int, input().split(' '))
	if (b - a) / (c + d) % 1 == 0:
		print((b - a) // (c + d))
	else:
		print(-1)


n = int(input())
l = []
for i in range(n):
	m = list(map(int, input().split()))
	l.append(m)
for i in l:
	a = i[2]
	b = i[3]
	x = i[0]
	y = i[1]
	jump = 0
	if (y - x) % (a + b) == 0:
		print((y - x) // (a + b))
	else:
		print(-1)


n = int(input())
for i in range(n):
	c = list(map(int, input().split(' ')))
	x = (c[1] - c[0]) / (c[2] + c[3])
	(i, j) = divmod(x, 1)
	if j == 0:
		print(int(x))
	else:
		print('-1')


def hop(x, y, a, b):
	if (y - x) % (a + b) == 0:
		print(int((y - x) / (a + b)))
	else:
		print('-1')
n = int(input())
for i in range(n):
	t = list(map(int, input().split()))
	hop(t[0], t[1], t[2], t[3])


cases = int(input())
for i in range(cases):
	p = input().split(' ')
	x = int(p[0])
	y = int(p[1])
	a = int(p[2])
	b = int(p[3])
	k = (y - x) / (a + b)
	if int(k) == k:
		print(int(k))
	else:
		print(-1)


import collections
local = False
if local:
	file = open('A.txt', 'r')

def readInput():
	if local:
		return file.readline()
	else:
		return input()

def solve(x, y, a, b):
	res = (y - x) / (a + b)
	if res == int(res) and res > 0:
		return int(res)
	return -1
t = int(readInput())
for i in range(t):
	xyab = readInput().split()
	(x, y, a, b) = (int(xyab[0]), int(xyab[1]), int(xyab[2]), int(xyab[3]))
	print(solve(x, y, a, b))


T = int(input())
for _ in range(T):
	(X, Y, A, B) = [int(x) for x in input().split()]
	d = Y - X
	if d % (A + B) == 0:
		print(d // (A + B))
	else:
		print(-1)


t = int(input())
results = []
for i in range(t):
	(x, y, a, b) = [int(i) for i in input().split(' ')]
	s = (y - x) / (a + b)
	int_s = int(s)
	if int_s - s != 0:
		int_s = -1
	results.append(int_s)
for i in results:
	print(i)


from math import inf
t = int(input())
for q in range(t):
	(x, y, a, b) = [int(i) for i in input().split()]
	d = y - x
	if d % (a + b) == 0:
		print(d // (a + b))
	else:
		print(-1)


def one():
	return int(input())

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

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

def st():
	return input()
for _ in range(one()):
	(x, y, a, b) = list(map(int, input().split()))
	d = y - x
	if d % (a + b) == 0:
		print(d // (a + b))
	else:
		print(-1)


t = int(input())
while t:
	(x, y, a, b) = [int(n) for n in input().split()]
	if (y - x) % (a + b) == 0:
		print((y - x) // (a + b))
	else:
		print('-1')
	t -= 1


t = int(input())
for _ in range(t):
	(x, y, a, b) = map(int, input().split())
	d = y - x
	m = a + b
	if d % m == 0:
		print(d // m)
	else:
		print(-1)


t = int(input())
for j in range(t):
	(x, y, a, b) = list(map(int, input().split()))
	s = (y - x) / (a + b)
	if s == int(s):
		print(int(s))
	else:
		print(-1)


for __ in range(int(input())):
	(x, y, a, b) = list(map(int, input().split()))
	if (y - x) % (a + b) == 0:
		print((y - x) // (a + b))
	else:
		print(-1)


for _ in range(int(input())):
	(x, y, a, b) = map(int, input().split())
	if (y - x) % (b + a):
		print(-1)
	else:
		print((y - x) // (b + a))


import sys
tc = int(sys.stdin.readline())
for _ in range(tc):
	(x, y, a, b) = list(map(int, sys.stdin.readline().split()))
	tmp = y - x
	if tmp % (a + b) == 0:
		print(tmp // (a + b))
	else:
		print(-1)


t = int(input())
output = []
for j in range(t):
	s = str(input()).split(' ')
	x = int(s[0])
	y = int(s[1])
	a = int(s[2])
	b = int(s[3])
	ans = (y - x) // (a + b) if (y - x) % (a + b) == 0 else -1
	output.append(ans)
for i in output:
	print(i)


T = int(input())
for t in range(T):
	(x, y, a, b) = [int(x) for x in input().split(' ')]
	dist = y - x
	step = a + b
	if dist % step == 0:
		print(dist // step)
	else:
		print(-1)


print(*((lambda x, y, a, b: (y - x) // (a + b) if (y - x) % (a + b) == 0 else -1)(*map(int, input().split())) for i in range(int(input()))), sep='\n')


t = int(input())
for i in range(t):
	s = input()
	(x, y, a, b) = (int(s.split(' ')[0]), int(s.split(' ')[1]), int(s.split(' ')[2]), int(s.split(' ')[3]))
	if (y - x) % (a + b) == 0:
		print(int((y - x) / (a + b)))
	else:
		print(-1)


q = int(input())
for p in range(q):
	(x, y, a, b) = map(int, input().split())
	if (y - x) % (a + b) != 0:
		print(-1)
	else:
		print((y - x) // (a + b))


T = int(input())
for _ in range(0, T):
	(rab1, rab2, inc1, dec2) = map(int, input().split())
	if (rab2 - rab1) % (inc1 + dec2) == 0:
		print(int((rab2 - rab1) / (inc1 + dec2)))
	else:
		print('-1')


t = int(input())
while t != 0:
	t -= 1
	(x, y, a, b) = map(int, input().split(' '))
	c = y - x
	d = a + b
	if c % d == 0:
		print(int(c / d))
	else:
		print(-1)


for _ in range(int(input())):
	(a, b, c, d) = map(int, input().split())
	if (b - a) % (c + d) == 0:
		print((b - a) // (c + d))
	else:
		print(-1)


for _ in range(int(input())):
	(x, y, a, b) = map(int, input().split())
	dis = y - x
	if dis % (a + b) != 0:
		print(-1)
		continue
	else:
		print(dis // (a + b))


n = int(input())
for i in range(n):
	(x, y, a, b) = map(int, input().split())
	sol = (x - y) / (-b - a)
	if sol < 0 or sol % 1 != 0:
		print(-1)
	else:
		print(int(sol))


t = int(input())
while t > 0:
	num = list(map(int, input().split()))
	x = num[0]
	y = num[1]
	a = num[2]
	b = num[3]
	p = (y - x) / (a + b)
	if int(p) == p:
		print(int(p))
	else:
		print(-1)
	t -= 1


kl = int(input())
for l in range(kl):
	(x, y, a, b) = [int(i) for i in input().split()]
	if (y - x) % (a + b) == 0:
		print((y - x) // (a + b))
	else:
		print(-1)


import math

def s():
	(x, y, a, b) = [int(x) for x in input().split(' ')]
	if (y - x) % (a + b) == 0:
		print(int((y - x) / (a + b)))
	else:
		print(-1)
t = int(input())
for i in range(t):
	s()


t = int(input())
for ii in range(t):
	(x, y, a, b) = map(int, input().split())
	if (y - x) % (a + b) == 0:
		print((y - x) // (a + b))
	else:
		print(-1)


import sys, itertools, math
T = int(sys.stdin.readline())
for _ in range(T):
	(x, y, a, b) = [int(i) for i in sys.stdin.readline().strip().split(' ')]
	if (y - x) % (a + b) == 0:
		n = (y - x) // (a + b)
		print(n)
	else:
		print(-1)


for x in range(int(input())):
	(x, y, a, b) = list(map(int, input().strip().split()[:4]))
	n = int((y - x) / (a + b) + 1)
	if x + (n - 1) * a == y - (n - 1) * b:
		print(n - 1)
	else:
		print(-1)


t = int(input())
for i in range(t):
	(x, y, a, b) = map(int, input().split())
	(q, r) = divmod(y - x, a + b)
	if r == 0:
		print(q)
	else:
		print(-1)


for TS in range(int(input())):
	(R, r, BIG, small) = map(int, input().split())
	if abs(R - r) % (BIG + small) != 0:
		print(-1)
		continue
	else:
		print((r - R) // (BIG + small))


t = int(input())
for i in range(t):
	arr = [int(x) for x in input().split()]
	n = (arr[1] - arr[0]) / (arr[2] + arr[3])
	if n % 1 == 0:
		print(int(n))
	else:
		print('-1')


t = int(input())
for _ in range(t):
	(x, y, a, b) = map(int, input().split())
	z = y - x
	c = a + b
	if z % c != 0:
		print(-1)
		continue
	print(z // c)


from math import floor
t = int(input())
l = []
i = 0
while i < t:
	(x, y, a, b) = [int(x) for x in input().split()]
	l.append((y - x) / (a + b))
	i += 1
i = 0
while i < t:
	if floor(l[i]) == l[i]:
		print(int(l[i]))
	else:
		print(-1)
	i += 1


num_cases = int(input())
seconds = []
for current_case in range(num_cases):
	inp = input()
	inp = inp.split(' ')
	a_position = int(inp[0])
	b_position = int(inp[1])
	a_move = int(inp[2])
	b_move = int(inp[3])
	answer = (b_position - a_position) / (a_move + b_move)
	if answer == int(answer):
		print(int(answer))
	else:
		print(-1)


def rabbitMeet(x, y, a, b):
	rabbitMeet = (y - x) % (a + b)
	if rabbitMeet == 0:
		result = int((y - x) / (a + b))
	else:
		result = -1
	return result
x = input()
for i in range(int(x)):
	y = input()
	rabbit = y.split(' ')
	x = int(rabbit[0])
	y = int(rabbit[1])
	a = int(rabbit[2])
	b = int(rabbit[3])
	output = rabbitMeet(x, y, a, b)
	print(output)


t = int(input())
for i in range(t):
	(x, y, a, b) = map(int, input().split())
	times = (y - x) / (a + b)
	if times.is_integer():
		print(int(times))
	else:
		print('-1')


class Solution:

	def solve(self, x, y, a, b):
		diffYX = y - x
		sumAB = a + b
		if diffYX % sumAB != 0:
			return -1
		return diffYX // sumAB
sol = Solution()
t = int(input().strip())
for _ in range(t):
	[x, y, a, b] = list(map(int, input().strip().split()))
	print(sol.solve(x, y, a, b))


for x in range(int(input())):
	(t_p, s_p, a, b) = map(int, input().split())
	dis = s_p - t_p
	sp = a + b
	if dis % sp == 0:
		print(dis // sp)
	else:
		print(-1)


t = int(input())
k = []
for i in range(t):
	(x, y, a, b) = list(map(int, input().split()))
	n = (y - x) / (a + b)
	if int(n) == n:
		k.append(int(n))
	else:
		k.append(-1)
for i in k:
	print(i)


for _ in range(int(input())):
	(x, y, a, b) = [int(__) for __ in input().split()]
	if (y - x) % (a + b) == 0:
		print((y - x) // (a + b))
	else:
		print(-1)


t = int(input())
for _ in range(t):
	(x, y, a, b) = map(int, input().split())
	dist = y - x
	sec = 0
	speed = a + b
	ans = dist / speed
	if ans == int(ans):
		print(int(ans))
	else:
		print('-1')


from bisect import bisect_left as bl
from bisect import bisect_right as br
import heapq
import math
from collections import *
from functools import reduce, cmp_to_key
import sys
input = sys.stdin.readline
M = mod = 10 ** 9 + 7

def factors(n):
	return sorted(set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0))))

def inv_mod(n):
	return pow(n, mod - 2, mod)

def li():
	return [int(i) for i in input().rstrip('\n').split()]

def st():
	return input().rstrip('\n')

def val():
	return int(input().rstrip('\n'))

def li2():
	return [i for i in input().rstrip('\n').split(' ')]

def li3():
	return [int(i) for i in input().rstrip('\n')]
for _ in range(val()):
	(x, y, a, b) = li()
	if (y - x) / (a + b) == (y - x) // (a + b):
		print((y - x) // (a + b))
	else:
		print(-1)


import math
for _ in range(int(input())):
	(x, y, a, b) = map(int, input().split())
	f = 0
	p = (y - x) / (b + a)
	if int(p) == p:
		print(int(p))
	else:
		print('-1')


def I():
	return map(int, input().split())
for _ in range(int(input())):
	(x, y, a, b) = I()
	print('-1' if (y - x) % (a + b) else (y - x) // (a + b))


T = int(input())
for test in range(T):
	(x, y, a, b) = map(int, input().split())
	if (-x + y) % (a + b) == 0:
		print((-x + y) // (a + b))
	else:
		print(-1)


t = int(input())
for i in range(0, t):
	j = list(map(int, input().split()))
	if (j[1] - j[0]) % (j[2] + j[3]) != 0:
		print('-1')
	else:
		print(int((j[1] - j[0]) / (j[2] + j[3])))


n = int(input())
for i in range(n):
	(a, b, c, d) = input().split()
	a = int(a)
	b = int(b)
	c = int(c)
	d = int(d)
	distance = b - a
	speed = c + d
	if distance % speed == 0:
		print(distance // speed)
	else:
		print(-1)


t = int(input())
for case in range(t):
	(x, y, a, b) = list(map(int, input().split()))
	if (y - x) % abs(a + b) == 0:
		print((y - x) // abs(a + b))
	else:
		print(-1)


sp = lambda : list(map(int, input().split()))
si = lambda : int(input())
TESTCASES = si()
result = []
for TESTCASE in range(TESTCASES):
	(x, y, a, b) = sp()
	div = (y - x) // (a + b)
	if div * (a + b) == y - x:
		result.append(str(div))
	else:
		result.append('-1')
print('\n'.join(result))


n = int(input())
for i in range(n):
	(x, y, xs, ys) = map(int, input().split())
	if (y - x) % (xs + ys) == 0:
		print(int((y - x) / (xs + ys)))
	else:
		print(-1)


def gcd(a, b):
	if a % b == 0:
		return b
	else:
		return gcd(b, a % b)
t = int(input())
while t:
	(x, y, a, b) = map(int, input().split())
	len = y - x
	num = a + b
	if len % num == 0:
		print(int(len / num))
	else:
		print(-1)
	t -= 1


a = int(input())
for i in range(0, a):
	arr = list(map(int, input().split()))
	if (arr[1] - arr[0]) % (arr[2] + arr[3]) == 0:
		print(int((arr[1] - arr[0]) / (arr[2] + arr[3])))
	else:
		print(-1)


n = int(input())
for item in range(n):
	(x, y, a, b) = list(map(int, input().split()))
	if abs(x - y) / (a + b) - int(abs(x - y) / (a + b)) != 0:
		print(-1)
	else:
		print(abs(x - y) // (a + b))


import math
t = int(input())
while t:
	(x, y, a, b) = map(int, input().split())
	z = (y - x) / (a + b)
	if int(z) == z:
		print(int(z))
	else:
		print(-1)
	t = t - 1


def ii():
	return int(input())

def si():
	return input()

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

def li():
	return list(mi())
import math
for i in range(ii()):
	(x, y, a, b) = mi()
	dist = abs(y - x)
	t = a + b
	if dist // t == dist / t:
		ans = dist // t
	else:
		ans = -1
	print(ans)


from heapq import heappush, heappop, heapify
from collections import deque, defaultdict, Counter
import itertools
from itertools import permutations, combinations, accumulate
import sys
import bisect
import string
import math
import time

def I():
	return int(input())

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

def S():
	return input()

def MS():
	return map(str, input().split())

def LI():
	return [int(i) for i in input().split()]

def LI_():
	return [int(i) - 1 for i in input().split()]

def StoI():
	return [ord(i) - 97 for i in input()]

def ItoS(nn):
	return chr(nn + 97)

def input():
	return sys.stdin.readline().rstrip()

def show(*inp, end='\n'):
	if show_flg:
		print(*inp, end=end)
YN = {False: 'No', True: 'Yes'}
MOD = 10 ** 9 + 7
inf = float('inf')
IINF = 10 ** 10
l_alp = string.ascii_lowercase
u_alp = string.ascii_uppercase
nums = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10']
show_flg = False

def solve(T):
	(x, y, a, b) = MI()
	d = y - x
	if d % (a + b) == 0:
		print(d // (a + b))
	else:
		print(-1)

def main():
	T = I()
	for i in range(T):
		solve(T)
main()


for i in [*open(0)][1:]:
	(x, y, a, b) = map(int, i.split())
	print([(y - x) // (a + b), -1][(y - x) % (a + b) > 0])


n = int(input())
for i in range(n):
	k = list(map(int, input().split()))
	if (k[1] - k[0]) % (k[2] + k[3]) == 0:
		print((k[1] - k[0]) // (k[2] + k[3]))
	else:
		print('-1')


import sys
import math
from collections import defaultdict
from collections import deque
from itertools import combinations
from itertools import permutations
input = lambda : sys.stdin.readline().rstrip()
read = lambda : list(map(int, input().split()))
go = lambda : 1 / 0

def write(*args, sep='\n'):
	for i in args:
		sys.stdout.write('{}{}'.format(i, sep))
INF = float('inf')
MOD = int(1000000000.0 + 7)
YES = 'YES'
NO = 'NO'
for _ in range(int(input())):
	try:
		(x, y, a, b) = read()
		if (y - x) % (a + b) != 0:
			print(-1)
		else:
			print((y - x) // (a + b))
	except ZeroDivisionError:
		continue
	except Exception as e:
		print(e)
		continue


for _ in [0] * int(input()):
	(a, b, n, m) = map(int, input().split())
	if (b - a) % (n + m) == 0:
		print((b - a) // (n + m))
	else:
		print(-1)


cases = int(input())
for case in range(cases):
	(x, y, a, b) = [int(i) for i in input().split(' ')]
	s = (y - x) / (a + b)
	if s == int(s):
		print(int(s))
	else:
		print(-1)


for _ in range(int(input())):
	(x, y, a, b) = list(map(int, input().split()))
	t = (y - x) / (a + b)
	tz = (y - x) // (a + b)
	if t != tz:
		print(-1)
	else:
		print(tz)


import sys
T = int(sys.stdin.readline().strip())
for t in range(0, T):
	(x, y, a, b) = list(map(int, sys.stdin.readline().strip().split()))
	if (y - x) % (a + b) == 0:
		print((y - x) // (a + b))
	else:
		print(-1)


import sys

def answer(li):
	x = li[0]
	y = li[1]
	a = li[2]
	b = li[3]
	numerator = y - x
	denominator = a + b
	rest = numerator % denominator
	if rest == 0:
		print(int(numerator / denominator))
	else:
		print(-1)
n = int(input())
for i in range(n):
	li = list(map(int, input().split(' ')))
	answer(li)


for i in range(int(input())):
	(x, y, x1, y1) = map(int, input().split())
	if abs(x - y) % (x1 + y1) == 0:
		print(abs(x - y) // (x1 + y1))
	else:
		print(-1)


T = int(input())
for i in range(T):
	(x, y, a, b) = map(int, input().split())
	res = -1
	if (y - x) / (a + b) % 1 == 0:
		res = (y - x) // (a + b)
	print(res)


cases = int(input())
distances = [[*map(lambda x: int(x), input().split())] for i in range(cases)]

def intersection(distances):
	for i in distances:
		difference = i[1] - i[0]
		covered = i[2] + i[3]
		if difference % covered != 0:
			print(-1)
		else:
			print(difference // covered)
intersection(distances)


n = int(input())
while n:
	n -= 1
	list = [int(i) for i in input().split()]
	if (list[1] - list[0]) % (list[2] + list[3]) == 0:
		print((list[1] - list[0]) // (list[2] + list[3]))
	else:
		print(-1)


s = int(input())
rs = []
for i in range(s):
	ls = list(map(int, input().split()))
	dis = ls[1] - ls[0]
	foo = ls[2] + ls[3]
	if dis % foo == 0:
		rs.append(int(dis / foo))
	else:
		rs.append(-1)
for i in rs:
	print(i)


import math
import sys
import itertools

def sa(Type=int):
	return [Type(x) for x in input().split()]

def hasFraction(n):
	return n - math.floor(n) != 0

def solve(t):
	(x, y, a, b) = sa()
	t = (y - x) / (a + b)
	result = int(t)
	if t < 0 or hasFraction(t):
		result = -1
	print(result)
t = int(input())
for i in range(t):
	solve(i + 1)


from collections import OrderedDict
from math import fabs
from sys import stdin
from sys import stdout
d = OrderedDict()
t = int(stdin.readline())
while t:
	t -= 1
	(x, y, a, b) = [int(i) for i in input().split()]
	if fabs(x - y) % (a + b):
		stdout.write(str(-1) + '\n')
	else:
		stdout.write(str(int(fabs(x - y) // (a + b))) + '\n')


t = int(input())
for _ in range(t):
	(x, y, a, b) = map(int, input().split())
	ans = -1
	if (y - x) % (a + b) == 0:
		ans = (y - x) // (a + b)
	print(ans)


for _ in range(int(input())):
	z = list(map(int, input().split()))
	x = z[0]
	y = z[1]
	a = z[2]
	b = z[3]
	if (y - x) % (a + b) == 0:
		print((y - x) // (a + b))
	else:
		print(-1)


import sys
input = sys.stdin.readline
Q = int(input())
Query = [list(map(int, input().split())) for _ in range(Q)]
for (x, y, a, b) in Query:
	d = y - x
	r = a + b
	if d % r == 0:
		print(d // r)
	else:
		print(-1)


t = int(input())
s = []
for jnj in range(0, t):
	x = input()
	xx = x.split()
	x = int(xx[0])
	y = int(xx[1])
	a = int(xx[2])
	b = int(xx[3])
	h = (y - x) / (a + b)
	if h % 1 == 0:
		s.append(h)
	else:
		s.append(-1)
for i in s:
	print(int(i))


try:
	for i in range(int(input())):
		(x, y, a, b) = map(int, input().split())
		if (y - x) % (a + b) == 0:
			print((y - x) // (a + b))
		else:
			print(-1)
except:
	pass


t = int(input())
for _ in range(t):
	(x, y, a, b) = map(int, input().split())
	diff = y - x
	sum = a + b
	ans = diff / sum
	if int(ans) == ans:
		print(int(ans))
	else:
		print(-1)


import sys
q = int(input())
for _ in range(q):
	(x, y, a, b) = map(int, input().split())
	speed = a + b
	if (y - x) % speed == 0:
		print(abs(y - x) // speed)
	else:
		print(-1)


def zip_sorted(a, b):
	return (zip(*sorted(zip(a, b)))[0], zip(*sorted(zip(a, b)))[1])

def gcd(a, b):
	return math.gcd(a, b)

def lcm(a, b):
	return a * b // math.gcd(a, b)

def ncr(n, r):
	return math.comb(n, r)

def npr(n, r):
	return math.factorial(n) // math.factorial(n - r)

def decimal_to_binary(n):
	return bin(n).replace('0b', '')

def binary_to_decimal(s):
	return int(s, 2)
import sys, os.path
import math
from collections import defaultdict, deque
input = sys.stdin.readline
I = lambda : list(map(int, input().split()))
S = lambda : list(map(str, input()))

def main():
	(t,) = I()
	for t1 in range(t):
		(x, y, a, b) = I()
		num = y - x
		dem = a + b
		if num % dem == 0:
			print(num // dem)
		else:
			print(-1)
main()


cnt = int(input())
for i in range(cnt):
	readline = input().split()
	loc_br = int(readline[0])
	loc_sr = int(readline[1])
	a = int(readline[2])
	b = int(readline[3])
	if (loc_sr - loc_br) % (a + b) == 0:
		print(int((loc_sr - loc_br) / (a + b)))
	else:
		print(-1)


exec(int(input()) * 'x,y,a,b=map(int,input().split());y-=x;a=a+b; print(int(y/a)) if y%a==0 else print(-1);')


for i in range(int(input())):
	(x, y, a, b) = map(int, input().split())
	ans = (y - x) / (a + b)
	print(int(ans) if ans == int(ans) else -1)


import sys
import os
import time
import collections
from collections import Counter, deque
import itertools
import math
import timeit
import random

def sieve(n):
	if n < 2:
		return list()
	prime = [True for _ in range(n + 1)]
	p = 3
	while p * p <= n:
		if prime[p]:
			for i in range(p * 2, n + 1, p):
				prime[i] = False
		p += 2
	r = [2]
	for p in range(3, n + 1, 2):
		if prime[p]:
			r.append(p)
	return r

def divs(n, start=1):
	divisors = []
	for i in range(start, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n / i == i:
				divisors.append(i)
			else:
				divisors.extend([i, n // i])
	return divisors

def divn(n, primes):
	divs_number = 1
	for i in primes:
		if n == 1:
			return divs_number
		t = 1
		while n % i == 0:
			t += 1
			n //= i
		divs_number *= t

def flin(d, x, default=-1):
	left = right = -1
	for i in range(len(d)):
		if d[i] == x:
			if left == -1:
				left = i
			right = i
	if left == -1:
		return (default, default)
	else:
		return (left, right)

def ceil(n, k):
	return n // k + (n % k != 0)

def ii():
	return int(input())

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

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

def lcm(a, b):
	return abs(a * b) // math.gcd(a, b)

def prr(a, sep=' '):
	print(sep.join(map(str, a)))

def dd():
	return collections.defaultdict(int)

def ddl():
	return collections.defaultdict(list)
input = sys.stdin.readline
res = []
for _ in range(ii()):
	(x, y, a, b) = mi()
	r = -1 if (y - x) % (a + b) else (y - x) // (a + b)
	res.append(r)
prr(res, '\n')


from sys import stdin
input = stdin.readline
t = int(input())
for _ in range(t):
	(x, y, a, b) = map(int, input().split())
	if (y - x) % (a + b) == 0:
		print((y - x) // (a + b))
	else:
		print(-1)


n = int(input())
for i in range(n):
	lista = input()
	(i, f, d1, d2) = lista.split(' ')
	t = (int(f) - int(i)) / (int(d1) + int(d2))
	if (int(f) - int(i)) % (int(d1) + int(d2)) == 0:
		print(int(t))
	else:
		print(-1)


t = int(input())
for j in range(t):
	ch = input()
	L = [int(i) for i in ch.split()]
	x = L[0]
	y = L[1]
	a = L[2]
	b = L[3]
	if (y - x) / (a + b) == int((y - x) / (a + b)):
		print(int((y - x) / (a + b)))
	else:
		print(-1)


def solve(x1, y1, a1, b1):
	if (y1 - x1) % (a1 + b1) == 0:
		return int((y1 - x1) / (a1 + b1))
	else:
		return -1
n = int(input())
user1 = []
output = []
for i in range(n):
	user = input().split()
	x = int(user[0])
	y = int(user[1])
	a = int(user[2])
	b = int(user[3])
	output.append(solve(x, y, a, b))
for j in output:
	print(j)


n = int(input())
for i in range(n):
	(left_border, right_border, left_step, right_step) = list(map(int, input().split()))
	segment_size = right_border - left_border
	if segment_size % (left_step + right_step) == 0:
		number_of_hopping = segment_size // (left_step + right_step)
		print(number_of_hopping)
	else:
		print(-1)


def func():
	n = int(input())
	for i in range(n):
		(x, y, a, b) = map(int, input().split())
		if (y - x) % (a + b) != 0:
			print(-1)
		else:
			print(int((y - x) / (a + b)))
func()


def bunnyJi(x, y, a, b):
	dist = y - x
	speed = a + b
	if dist % speed == 0:
		return dist // speed
	return -1
for t in range(int(input())):
	(x, y, a, b) = map(int, input().split())
	print(bunnyJi(x, y, a, b))


inputs_count = int(input())
for i in range(inputs_count):
	(x, y, a, b) = tuple(map(int, input().split()))
	speed = a + b
	distance = y - x
	if distance % speed == 0:
		print(distance // speed)
	else:
		print(-1)


t = int(input())
for _ in range(t):
	data = str(input()).split()
	int_data = [int(i) for i in data]
	distance = int_data[1] - int_data[0]
	velocity = int_data[2] + int_data[3]
	if distance % velocity == 0:
		print(distance // velocity)
	else:
		print(-1)


t = int(input())
for _ in range(t):
	(x, y, a, b) = (int(e) for e in input().split(' '))
	x = y - x
	if x % (a + b) == 0:
		print(x // (a + b))
	else:
		print(-1)


n = int(input())
for i in range(n):
	(x, y, a, b) = map(int, input().split())
	u = (y - x) // (a + b)
	if y - x == u * (a + b):
		print(u)
	else:
		print(-1)


t = int(input())
count = 0
for i in range(t):
	(x, y, a, b) = [int(i) for i in input().split()]
	rem = (y - x) % (a + b)
	que = (y - x) // (a + b)
	if rem == 0:
		print(que)
	else:
		print(-1)


t = int(input())
for i in range(t):
	(x, y, a, b) = map(int, input().split())
	n = y - x
	m = a + b
	p = n % m
	q = n // m
	if p == 0:
		print(q)
	else:
		print(-1)


for i in range(int(input())):
	(x, y, a, b) = input().split()
	x = int(x)
	y = int(y)
	a = int(a)
	b = int(b)
	time = 0
	diff = y - x
	if diff % (a + b) == 0:
		time = diff // (a + b)
	if time == 0:
		print(-1)
	else:
		print(time)


k = int(input())
l = []
for i in range(k):
	d = input()
	d = d.split()
	p1 = int(d[1]) - int(d[0])
	a = int(d[2]) + int(d[3])
	if p1 % a == 0:
		l.append(p1 / a)
	else:
		l.append(-1)
for i in range(k):
	print(int(l[i]))


T = int(input())
for _ in range(T):
	(x, y, a, b) = map(int, input().split(' '))
	(_1, _2) = divmod(abs(x - y), a + b)
	print(-1 if _2 != 0 else _1)


t = int(input())
for _ in range(t):
	(x, y, a, b) = [int(x) for x in input().strip().split()]
	res = -1
	if (y - x) % (a + b) == 0:
		res = (y - x) // (a + b)
	print(res)


n = int(input())
for i in range(0, n):
	(x, y, a, b) = map(int, input().split())
	v = a + b
	d = y - x
	output = d / v
	if output % 2 > 0 and output % 2 < 1:
		print(-1)
	elif output % 2 > 1 and output % 2 < 2:
		print(-1)
	else:
		print(int(output))


import math
for _ in range(int(input())):
	(m, n, x, y) = list(map(int, input().split()))
	i = (n - m) / (y + x)
	if math.ceil(i) == math.floor(i):
		print(int(i))
	else:
		print(-1)


test_cases = int(input())
for test in range(test_cases):
	(x, y, a, b) = map(int, input().strip().split())
	distance = y - x
	if distance % (a + b) == 0:
		print(distance // (a + b))
	else:
		print(-1)


def main(x, y, a, b):
	ab = a + b
	xy = abs(x - y)
	if xy % ab != 0:
		return -1
	else:
		return int(xy / ab)
t = int(input())
for t_itr in range(t):
	xyab = list(map(int, input().rstrip().split()))
	x = xyab[0]
	y = xyab[1]
	a = xyab[2]
	b = xyab[3]
	res = main(x, y, a, b)
	print(res)


t = int(input())
res = []
for i in range(t):
	l = list(map(int, input().split()))
	x = l[0]
	y = l[1]
	a = l[2]
	b = l[3]
	if (y - x) % (a + b) == 0:
		res.append(int((y - x) / (a + b)))
	else:
		res.append(-1)
for i in res:
	print(i)


import sys, os, io
from math import log, gcd, ceil
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop
from sys import stdin
import math

def ncr(n, r, p):
	num = den = 1
	for i in range(r):
		num = num * (n - i) % p
		den = den * (i + 1) % p
	return num * pow(den, p - 2, p) % p

def primeFactors(n):
	l = []
	while n % 2 == 0:
		l.append(2)
		n = n / 2
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		while n % i == 0:
			l.append(int(i))
			n = n / i
	if n > 2:
		l.append(n)
	return list(set(l))

def power(x, y, p):
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def si():
	return input()

def prefix_sum(arr):
	r = [0] * (len(arr) + 1)
	for (i, el) in enumerate(arr):
		r[i + 1] = r[i] + el
	return r

def divideCeil(n, x):
	if n % x == 0:
		return n // x
	return n // x + 1

def ii():
	return int(input())

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

def ws(s):
	sys.stdout.write(s + '\n')

def wi(n):
	sys.stdout.write(str(n) + '\n')

def wia(a):
	sys.stdout.write(' '.join([str(x) for x in a]) + '\n')
if os.path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
mod = 998244353
t = 1
t = ii()
for _ in range(t):
	(x, y, a, b) = li()
	d = y - x
	if d % (a + b) == 0:
		print(d // (a + b))
	else:
		print(-1)


t = int(input())
for _ in range(0, t):
	arr = list(map(int, input().strip().split(' ')))
	summ = arr[2] + arr[3]
	k = (arr[1] - arr[0]) % summ
	if k == 0:
		print(int((arr[1] - arr[0]) / summ))
	else:
		print(-1)


def get_iter_time(x, y, a, b):
	time = (y - x) // (a + b)
	if time * (a + b) == y - x:
		return time
	else:
		return -1
nb_of_test = int(input())
for k in range(nb_of_test):
	test_case = input().split(' ')
	print(get_iter_time(int(test_case[0]), int(test_case[1]), int(test_case[2]), int(test_case[3])))


import sys

def input():
	return sys.stdin.readline().strip()

def list2d(a, b, c):
	return [[c] * b for i in range(a)]

def list3d(a, b, c, d):
	return [[[d] * c for j in range(b)] for i in range(a)]

def list4d(a, b, c, d, e):
	return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]

def ceil(x, y=1):
	return int(-(-x // y))

def INT():
	return int(input())

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

def LIST(N=None):
	return list(MAP()) if N is None else [INT() for i in range(N)]

def Yes():
	print('Yes')

def No():
	print('No')

def YES():
	print('YES')

def NO():
	print('NO')
INF = 10 ** 18
MOD = 10 ** 9 + 7

def bisearch_max(mn, mx, func):
	ok = mn
	ng = mx
	while ok + 1 < ng:
		mid = (ok + ng) // 2
		if func(mid):
			ok = mid
		else:
			ng = mid
	return ok

def check(m):
	res = y - b * m - (x + a * m)
	return res >= 0
for _ in range(INT()):
	(x, y, a, b) = MAP()
	res = bisearch_max(0, 10 ** 18, check)
	if y - b * res - (x + a * res) == 0:
		print(res)
	else:
		print(-1)


n = int(input())
for _ in range(n):
	(x, y, a, b) = list(map(int, input().split()))
	c = (y - x) / (a + b)
	if c % 1 == 0:
		print(int(c))
	else:
		print(-1)


def samePosition(case):
	case[1] -= case[0]
	t = case[1] % (case[2] + case[3])
	if t == 0:
		return int(case[1] / (case[2] + case[3]))
	return -1
n = int(input())
ans = []
for i in range(n):
	case = list(map(int, input().split(' ')))
	ans.append(samePosition(case))
for x in ans:
	print(x)


t = int(input())
for majoration in range(t):
	(x, y, a, b) = map(int, input().split())
	paz = y - x
	sanction = a + b
	if sanction > paz or paz % sanction != 0:
		print(-1)
	else:
		issou = (y - x) // (a + b)
		print(issou)


t = int(input())
while t > 0:
	t = t - 1
	(x, y, a, b) = map(int, input().split())
	net = a + b
	d = abs(y - x)
	f = d % net
	if f != 0:
		print(-1)
	else:
		l = d / net
		print(int(l))


T = int(input())
for i in range(T):
	line = input().split(' ')
	x = int(line[0])
	y = int(line[1])
	a = int(line[2])
	b = int(line[3])
	if (x - y) % (a + b) == 0:
		print((y - x) // (a + b))
	else:
		print(-1)


t = int(input())
for i in range(t):
	arr = list(map(int, input().split()))
	x = arr[0]
	y = arr[1]
	a = arr[2]
	b = arr[3]
	for1 = abs(y - x) / (a + b)
	for2 = abs(y - x) // (a + b)
	if for1 == for2:
		print(for2)
	else:
		print(-1)


from math import *
t = int(input())
for y in range(t):
	(x, y, a, b) = list(map(int, input().split()))
	if (y - x) % (a + b) != 0:
		print(-1)
	else:
		print((y - x) // (a + b))


n = int(input())
for i in range(0, n):
	flag = -1
	(a, b, p, q) = map(int, input().split())
	temp = abs(a - b)
	if temp % (p + q) == 0:
		print(temp // (p + q))
	else:
		print(-1)


x = int(input())
m = []
for i in range(x):
	z = input()
	l = z.split(' ')
	for r in range(len(l)):
		l[r] = int(l[r])
	c = l[1] - l[0]
	d = l[2] + l[3]
	if c % d == 0:
		k = int(c / d)
	else:
		k = -1
	m.append(k)
for f in m:
	print(f)


for i in range(int(input())):
	(w, x, y, z) = map(int, input().split())
	print((lambda a, b, c, d: (b - a) // (c + d) if (b - a) % (c + d) == 0 else -1)(w, x, y, z))


def twoRabbits(arr):
	(tr, sr, thd, shd) = (arr[0], arr[1], arr[2], arr[3])
	if (sr - tr) % (thd + shd) == 0:
		return (sr - tr) // (thd + shd)
	else:
		return -1
tc = int(input())
for i in range(tc):
	inp = list(map(int, input().split()))
	print(twoRabbits(inp))


for i in range(int(input())):
	(m, n, a, b) = map(int, input().split())
	o = n - m
	p = a + b
	if o % p == 0:
		print(o // p)
	else:
		print(-1)


import sys
from pprint import pprint
if not 'DEBUG' in globals():
	readline = sys.stdin.readline

def read(map_func):
	return map_func(readline().rstrip())

def reads(map_func):
	return list(map(map_func, readline().rstrip().split()))

def readn(map_func, n):
	return [map_func(readline().rstrip()) for _ in range(n)]

def readint():
	return read(int)

def readints():
	return reads(int)

def readcol(n):
	return readn(int, n)

def readmat(n):
	return [readints() for _ in range(n)]

def readmap(n):
	return readn(list, n)

def makemat(n, m, v):
	return [[v for _ in range(m)] for _ in range(n)]

def zeromat(n, m=None):
	return makemat(n, m if m else n, 0)

def listmat(n, m=None):
	return [[[] for _ in range(m if m else n)] for _ in range(n)]

def crosslist(y, x, n=None, m=None):
	return [(p, q) for (p, q) in [(y, x + 1), (y - 1, x), (y, x - 1), (y + 1, x)] if (n == None or 0 <= p < n) and (m == None or 0 <= q < m)]

def roundlist(y, x, n=None, m=None):
	return [(p, q) for (p, q) in [(y, x + 1), (y - 1, x + 1), (y - 1, x), (y - 1, x - 1), (y, x - 1), (y + 1, x - 1), (y + 1, x), (y + 1, x + 1)] if (n == None or 0 <= p < n) and (m == None or 0 <= q < m)]

def plog(obj):
	pprint(obj) if 'DEBUG' in globals() else None

def log(msg, label=None):
	print((label + ': ' if label else '') + str(msg)) if 'DEBUG' in globals() else None

def _logmat(mat, label=None):
	fmt = '{:' + str(max((max((len(str(s)) for s in m)) for m in mat))) + 'd}'
	f = lambda row: '[' + ' '.join((fmt.format(x) for x in row)) + ']'
	[log('[' + f(row), label) if i == 0 else log((' ' * (len(label) + 3) if label else ' ') + f(row) + ']', None) if i == len(mat) - 1 else log((' ' * (len(label) + 3) if label else ' ') + f(row), None) for (i, row) in enumerate(mat)]

def logmat(mat, label=None):
	_logmat(mat, label) if 'DEBUG' in globals() else None
for _ in range(readint()):
	(x, y, a, b) = readints()
	(d, r) = divmod(y - x, a + b)
	if r == 0:
		print(d)
	else:
		print(-1)


import sys
import math
fileoperation = 0
if fileoperation:
	orig_stdout = sys.stdout
	orig_stdin = sys.stdin
	inputfile = open('W:/Competitive Programming/input.txt', 'r')
	outputfile = open('W:/Competitive Programming/output.txt', 'w')
	sys.stdin = inputfile
	sys.stdout = outputfile
mod = 1000000007

def nospace(l):
	ans = ''.join((str(i) for i in l))
	return ans
t = int(input())
for tt in range(t):
	(x, y, a, b) = map(int, sys.stdin.readline().split(' '))
	if x == y:
		print(0)
		continue
	if (y - x) % (a + b):
		print(-1)
	else:
		print((y - x) // (a + b))
if fileoperation:
	sys.stdout = orig_stdout
	sys.stdin = orig_stdin
	inputfile.close()
	outputfile.close()


import math
testCases = int(input())
for _ in range(testCases):
	(x, y, a, b) = [int(x) for x in input().split()]
	answer = (y - x) / (a + b)
	if answer % 1 == 0:
		print(int(answer))
	else:
		print(-1)


for _ in range(int(input())):
	(x, y, x1, y1) = list(map(int, input().split()))
	res = 0
	print(int((y - x) / (x1 + y1)) if (y - x) % (x1 + y1) == 0 else '-1')


for i in range(int(input())):
	x = list(map(int, input().split()))
	if (x[1] - x[0]) / (x[2] + x[3]) % 1 > 0:
		print(-1)
	else:
		print(int((x[1] - x[0]) / (x[2] + x[3])))


x = int(input())
for i in range(x):
	(y, z, a, b) = [int(x) for x in input().split()]
	if (z - y) % (a + b) == 0:
		print((z - y) // (a + b))
	else:
		print('-1')


for t in range(int(input())):
	(x, y, a, b) = (int(i) for i in input().split())
	n = (y - x) // (a + b)
	(h, l, ans) = (x + a * (n - 1), y - b * (n - 1), n - 1)
	while h <= l:
		h += a
		l -= b
		ans += 1
		if h == l:
			print(ans)
			break
	else:
		print(-1)


t = int(input())
for _ in range(t):
	(x, y, a, b) = list(map(int, input().rstrip().split()))
	dis = y - x
	sp = a + b
	if dis % sp == 0:
		t = int(dis // sp)
		print(t)
	else:
		print(-1)


t = int(input())
for _ in range(t):
	(x, y, a, b) = map(int, input().split())
	print([(y - x) // (a + b), -1][bool((y - x) % (a + b))])


t = int(input())
while t:
	t -= 1
	(x, y, a, b) = map(int, input().split())
	(mul, rem) = divmod(y - x, a + b)
	if rem == 0:
		print(mul)
	else:
		print('-1')


def main():
	T = int(input().strip())
	for _ in range(T):
		(x, y, a, b) = list(map(int, input().strip().split()))
		d = y - x
		if d % (a + b) == 0:
			print(d // (a + b))
		else:
			print(-1)
main()


q = int(input())
for u in range(q):
	(x, y, a, b) = [int(i) for i in input().split()]
	if (y - x) % (a + b) == 0:
		print((y - x) // (a + b))
	else:
		print(-1)


t = int(input())
C = []
for i in range(0, t):
	(x, y, a, b) = [int(j) for j in input().split()]
	c = (y - x) / (a + b)
	if c.is_integer():
		C.append(int(c))
	else:
		C.append('-1')
for i in C:
	print(i)


def solve2(pos1, pos2, d1, d2, time=0):
	if pos1 == pos2:
		return time
	elif pos1 > pos2:
		return -1
	else:
		return solve(pos1 + d1, pos2 - d2, d1, d2, time + 1)

def solve(pos1, pos2, d1, d2):
	a = pos1 - pos2
	b = d1 + d2
	if a / b == int(a / b):
		return int(-a / b)
	else:
		return -1
input()
while True:
	try:
		val = input().split(' ')
		for i in range(len(val)):
			val[i] = int(val[i])
		print(solve(val[0], val[1], val[2], val[3]))
	except EOFError:
		break


for _ in range(int(input())):
	(s, e, a, b) = [int(x) for x in input().split()]
	distance = e - s
	perunit = a + b
	(time, rest) = divmod(distance, perunit)
	if rest == 0:
		print(time)
	else:
		print(-1)


def ii():
	return int(input())

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

def mi():
	return map(int, input().split())
for _ in range(ii()):
	(x, y, a, b) = mi()
	if (y - x) % (a + b):
		print(-1)
	else:
		print((y - x) // (a + b))


from sys import stdin
inp = lambda : int(stdin.readline().strip())
lip = lambda : [int(i) for i in stdin.readline().strip().split(' ')]
sip = lambda : stdin.readline().strip()
for _ in range(inp()):
	(x, y, a, b) = lip()
	t = (y - x) / (a + b)
	print(-1 if t % 1 else int(t))


t = int(input())
for i in range(t):
	(x, y, a, b) = map(int, input().split())
	time = (y - x) / (a + b)
	ty = (y - x) // (a + b)
	if time == ty:
		print(ty)
	else:
		print(-1)


import sys
from math import ceil
read = lambda : list(map(int, sys.stdin.readline().strip().split()))
for _ in range(int(input())):
	(x, y, a, b) = read()
	(q, r) = divmod(y - x, a + b)
	print([-1, q][r == 0])


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 main():
	n = inp()
	for i in range(n):
		[s0, s1, m, n] = inlt()
		if (s1 - s0) % (m + n) == 0:
			print(int((s1 - s0) / (m + n)))
		else:
			print(-1)
main()


import math
for _ in range(int(input())):
	(x, y, a, b) = map(int, input().split())
	ans = (y - x) / (a + b)
	if math.ceil(ans) == math.floor(ans):
		print(int(ans))
	else:
		print(-1)


for t in range(int(input())):
	(x, y, a, b) = [int(n) for n in input().split()]
	if ((y - x) / (b + a)).is_integer():
		print(int((y - x) / (b + a)))
	else:
		print(-1)


import sys
read = lambda : list(map(int, sys.stdin.readline().strip().split()))
for _ in range(int(input())):
	(x, y, a, b) = read()
	if (y - x) % (a + b) == 0:
		print((y - x) // (a + b))
	else:
		print('-1')


fo = int(input())
for i in range(fo):
	x = [int(i) for i in input().split()]
	dis = x[1] - x[0]
	l = x[2] + x[3]
	if dis / l != dis // l:
		print('-1')
	else:
		print(dis // l)


n = input()
for i in range(int(n)):
	(x, y, a, b) = map(int, input().split())
	z = float((y - x) / (a + b))
	if z.is_integer() == True:
		print(int(z))
	else:
		print(-1)


cases = int(input())
for _ in range(cases):
	(x, y, a, b) = map(int, input().split())
	(d, s) = (y - x, a + b)
	if d % s != 0:
		print(-1)
	else:
		print(d // s)


import math, sys, itertools
wtf = sys.stdin.read()
wtf = wtf.strip().split('\n')
for t in wtf[1:]:
	(x, y, a, b) = map(int, t.split())
	l = y - x
	s = a + b
	print(l // s if l % s == 0 else '-1')


t = int(input())
for _ in range(t):
	(x, y, a, b) = map(int, input().split())
	(ok, ng) = (0, 10 ** 18)
	while ng - ok > 1:
		mid = (ok + ng) // 2
		if mid * a + mid * b <= y - x:
			ok = mid
		else:
			ng = mid
	if ok * a + ok * b == y - x:
		print(ok)
	else:
		print(-1)


case = int(input())
for caseNum in range(0, case):
	(x1, x2, step1, step2) = [int(x) for x in input().split()]
	diff = x2 - x1
	if diff % (step1 + step2) == 0:
		print(int(diff / (step1 + step2)))
	else:
		print(-1)


a = int(input())
i = 0
k = []
while i < a:
	l = list(map(int, input().split(' ')))
	k.append(l)
	i = i + 1
for x in k:
	n = (x[1] - x[0]) / (x[2] + x[3])
	if n == int(n):
		print(int(n))
	else:
		print(-1)


from sys import stdin
cases = int(stdin.readline().strip())
for i in range(cases):
	(x, y, a, b) = [int(x) for x in stdin.readline().strip().split(' ')]
	if (y - x) % (a + b) == 0:
		print((y - x) // (a + b))
	else:
		print('-1')


import sys

def input():
	return sys.stdin.readline().strip()

def list2d(a, b, c):
	return [[c] * b for i in range(a)]

def list3d(a, b, c, d):
	return [[[d] * c for j in range(b)] for i in range(a)]

def list4d(a, b, c, d, e):
	return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]

def ceil(x, y=1):
	return int(-(-x // y))

def INT():
	return int(input())

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

def LIST(N=None):
	return list(MAP()) if N is None else [INT() for i in range(N)]

def Yes():
	print('Yes')

def No():
	print('No')

def YES():
	print('YES')

def NO():
	print('NO')
INF = 10 ** 18
MOD = 10 ** 9 + 7
for _ in range(INT()):
	(x, y, a, b) = MAP()
	t = (y - x) / (b + a)
	if t.is_integer():
		print(int(t))
	else:
		print(-1)


t = int(input())
for i in range(t):
	(x, y, a, b) = list(map(int, input().split()))
	if x == y:
		print(0)
	elif y < x:
		print(-1)
	elif (y - x) % (a + b) == 0:
		print((y - x) // (a + b))
	else:
		print(-1)


import math
for _ in range(int(input())):
	(x, y, a, b) = [int(i) for i in input().split()]
	lal = (y - x) / (a + b)
	if math.ceil(lal) == math.floor(lal):
		print(int(lal))
	else:
		print(-1)


import sys
input = sys.stdin.readline
for i in range(int(input())):
	(x, y, a, b) = map(int, input().split())
	s = y - x
	speed = a + b
	if speed >= 0 and s % speed == 0:
		if speed == 0:
			if x == y:
				print(0)
			else:
				print(-1)
		print(s // speed)
	else:
		print(-1)


import sys
reader = (s.rstrip() for s in sys.stdin)
input = reader.__next__

def gift():
	for _ in range(t):
		(x, y, a, b) = [int(x) for x in input().split()]
		if (y - x) % (a + b) == 0:
			yield ((y - x) // (a + b))
		else:
			yield (-1)
t = int(input())
ans = gift()
print(*ans, sep='\n')


n = int(input())
i = 0
while i < n:
	(x, y, a, b) = map(int, input().split())
	if (y - x) % (a + b) == 0:
		print(int((y - x) / (a + b)))
	else:
		print('-1')
	i += 1


for i in range(int(input())):
	(x, y, a, b) = [int(x) for x in input().split()]
	k = (y - x) % (a + b)
	j = (y - x) // (a + b)
	if k == 0:
		print(j)
	else:
		print(-1)


for _ in [*open(0)][1:]:
	(x, y, a, b) = map(int, _.split())
	if ((y - x) / (a + b)).is_integer() and y >= x:
		print((y - x) // (a + b))
	else:
		print(-1)


n = int(input())
for ii in range(n):
	(x, y, a, b) = map(int, input().split())
	x = y - x
	a = a + b
	print((x // a, -1)[x % a > 0])


import math
for i in range(int(input())):
	(a, b, c, d) = map(int, input().split())
	e = 0
	e = (b - a) / (c + d)
	if e % 1 != 0:
		print(-1)
	else:
		print(math.floor(e))


import sys
inp = sys.stdin.readline
input = lambda : inp().strip()
flush = sys.stdout.flush

def iin():
	return int(input())

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

def main():
	T = iin()
	while T:
		T -= 1
		(x, y, a, b) = lin()
		if y - x >= 0 and (y - x) % (a + b) == 0:
			print((y - x) // (a + b))
		else:
			print(-1)
main()


test = int(input())
for _ in range(test):
	(x, y, a, b) = map(int, input().split())
	val1 = y - x
	val2 = a + b
	if val1 % val2 != 0:
		print(-1)
	else:
		print(val1 // val2)


import string

def main():
	(x, y, a, b) = map(int, input().split())
	dist = y - x
	if dist % (a + b) != 0:
		print(-1)
	else:
		print(dist // (a + b))
t = int(input())
for i in range(t):
	main()


import sys

def main():
	N = int(sys.stdin.readline().strip())
	for _ in range(N):
		(x, y, a, b) = [int(x) for x in sys.stdin.readline().split()]
		if (y - x) % (a + b) == 0:
			print((y - x) // (a + b))
		else:
			print(-1)
main()


import sys
input = sys.stdin.readline
t = int(input())
while t:
	t -= 1
	(x, y, a, b) = map(int, input().split())
	d = abs(x - y)
	if d % (a + b) == 0:
		print(d // (a + b))
	else:
		print(-1)


import sys
n = int(input())
ans = []

def solve(x, y, a, b):
	dist = y - x
	delta = a + b
	if dist % delta == 0:
		return dist // delta
	else:
		return -1
for i in range(n):
	(x, y, a, b) = map(int, sys.stdin.readline().split())
	ans.append(solve(x, y, a, b))
print('\n'.join(map(str, ans)))


from sys import stdin, stdout
from os import path
if path.exists('inp.txt'):
	stdin = open('inp.txt', 'r')
q = int(stdin.readline())
for _ in range(q):
	(x, y, a, b) = map(int, stdin.readline().split())
	print(int((y - x) / (a + b)) if not (y - x) % (a + b) else -1)


import math
import collections
import functools
import sys
import os

def solve():
	(x, y, a, b) = map(int, input().split())
	if (y - x) % (b + a):
		print(-1)
		return
	else:
		print((y - x) // (a + b))
		return

def main():
	T = 1
	T = int(input())
	while T:
		solve()
		T -= 1
main()


t = int(input())
a = []
for i in range(t):
	b = list(map(int, input().split()))
	a.append(b)
for i in a:
	k = i[1] - i[0]
	q = i[2] + i[3]
	if k % q == 0:
		print(k // q)
	else:
		print(-1)


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
testcases = int(input())
for j in range(testcases):
	(x, y, a, b) = map(int, input().split())
	t = -1
	t = (y - x) / (a + b)
	if t % 1 == 0:
		print(int(t))
	else:
		print(-1)


t = int(input().rstrip())
result = list()
for i in range(t):
	temp = list(map(int, input().rstrip().split()))
	x = temp[0]
	y = temp[1]
	a = temp[2]
	b = temp[3]
	n = (y - x) // (b + a)
	if n * (b + a) != y - x:
		result.append(-1)
	else:
		result.append(n)
for i in result:
	print(i)


t = int(input())
for _ in range(t):
	(x, y, a, b) = map(int, input().split())
	g = (y - x) / (a + b)
	if g.is_integer():
		print(int(g))
	else:
		print(-1)


t = int(input())
for _ in range(t):
	a = list(map(int, input().split()))
	(x, y, a, b) = (a[0], a[1], a[2], a[3])
	ans = y - x
	d = a + b
	if ans % d == 0:
		print(ans // d)
	else:
		print(-1)


def solve(x, y, a, b):
	m = x - y
	n = -1 * b - a
	if m != 0:
		if m % n == 0:
			print(m // n)
		else:
			print(-1)
	else:
		print(-1)
num_iter = int(input())
while num_iter != 0:
	(x, y, a, b) = list(map(int, input().split()))
	solve(x, y, a, b)
	num_iter -= 1


n = int(input())
for i in range(n):
	(x, y, a, b) = [int(j) for j in input().split(' ')]
	d = y - x
	mov = a + b
	print(d // mov if d // mov == d / mov else -1)


t = int(input())
for k in range(0, t):
	x = [int(k) for k in input().split()]
	s = x[2] + x[3]
	d = x[1] - x[0]
	if d % s == 0:
		print(d // s)
	else:
		print('-1')


for i in range(int(input())):
	list1 = []
	caption = list(map(int, input().split()))
	for j in caption:
		list1.append(j)
	if (list1[1] - list1[0]) % (list1[2] + list1[3]) == 0:
		print((list1[1] - list1[0]) // (list1[2] + list1[3]))
	else:
		print(-1)


def read_array():
	x = []
	x1 = []
	x = input()
	x = x.split(' ')
	for r in range(len(x)):
		x1.append(int(x[r]))
	return x1

def rabbits(x):
	if x[0] > x[1]:
		return -1
	if (x[1] - x[0]) % (x[2] + x[3]) == 0:
		return (x[1] - x[0]) // (x[2] + x[3])
	else:
		return -1
m = int(input())
res = []
for i in range(m):
	x = read_array()
	n = rabbits(x)
	res.append(n)
for v in res:
	print(v)


def examA():
	t = I()
	ans = []
	for _ in range(t):
		(x, y, a, b) = LI()
		if (y - x) % (a + b) != 0:
			cur = -1
		else:
			cur = (y - x) // (a + b)
		ans.append(cur)
	for v in ans:
		print(v)
	return

def examB():
	ans = 0
	print(ans)
	return

def examC():
	ans = 0
	print(ans)
	return

def examD():
	ans = 0
	print(ans)
	return

def examE():
	ans = 0
	print(ans)
	return

def examF():
	ans = 0
	print(ans)
	return
import sys, copy, bisect, itertools, heapq, math, random
from heapq import heappop, heappush, heapify
from collections import Counter, defaultdict, deque

def I():
	return int(sys.stdin.readline())

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

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

def LS():
	return sys.stdin.readline().split()

def SI():
	return sys.stdin.readline().strip()
global mod, mod2, inf, alphabet, _ep
mod = 10 ** 9 + 7
mod2 = 998244353
inf = 10 ** 18
_ep = 10 ** (-12)
alphabet = [chr(ord('a') + i) for i in range(26)]
examA()


t = int(input())
d = []
for i in range(t):
	(x, y, a, b) = map(int, input().split())
	if (y - x) % (a + b) == 0:
		d.append((y - x) / (a + b))
	else:
		d.append('-1')
for i in d:
	print(int(i))


a = int(input())
for j in range(a):
	l = list(map(int, input().split()))
	if (l[1] - l[0]) % (l[2] + l[3]) == 0:
		print(int((l[1] - l[0]) / (l[2] + l[3])))
	else:
		print(-1)


def judge(t):
	return x + a * t <= y - b * t

def binary_search():
	(l, r) = (0, 10 ** 9)
	while l <= r:
		mid = (l + r) // 2
		if judge(mid):
			l = mid + 1
		else:
			r = mid - 1
	return r
t = int(input())
for _ in range(t):
	(x, y, a, b) = map(int, input().split())
	t = binary_search()
	if x + a * t == y - b * t:
		print(t)
	else:
		print(-1)


from math import ceil, floor
for i in range(int(input())):
	(a, b, c, d) = map(int, input().split())
	x = (b - a) / (c + d)
	if floor(x) == ceil(x):
		print(int(x))
	else:
		print(-1)


n = int(input())
cases = []
for i in range(n):
	cases.append(list(map(int, input().split())))
for i in cases:
	d = i[1] - i[0]
	if d % (i[2] + i[3]) != 0:
		print(-1)
	else:
		print(d // (i[2] + i[3]))


def main():
	for _ in range(int(input())):
		(x1, x2, a, b) = map(int, input().split())
		print((x2 - x1) // (a + b) if (x2 - x1) % (a + b) == 0 else -1)
main()


t = int(input())
while t:
	t -= 1
	arr = [int(i) for i in input().split(' ')]
	(x, y, a, b) = (arr[0], arr[1], arr[2], arr[3])
	if (y - x) % (a + b) != 0:
		print('-1')
	else:
		print((y - x) // (a + b))


t = int(input())
for v in range(t):
	temp = list(map(int, input().rstrip().split()))
	count = 0
	result = -1
	x = temp[0]
	y = temp[1]
	a = temp[2]
	b = temp[3]
	n = (y - x) % (a + b)
	m = (y - x) // (a + b)
	if n == 0:
		print(m)
	else:
		print(-1)


from math import *
import itertools
zzz = int(input())
for zz in range(zzz):
	(x, y, a, b) = map(int, input().split())
	s = y - x
	t = s / (a + b)
	if int(t) == t:
		print(int(t))
	else:
		print(-1)


t = int(input())
for s in range(t):
	(x, y, a, b) = map(int, input().split())
	d = y - x
	e = a + b
	if d % e == 0:
		print(d // e)
	else:
		print('-1')


t = int(input())
while t != 0:
	a = list(map(int, input().split()))
	if (a[1] - a[0]) % (a[2] + a[3]) == 0:
		print((a[1] - a[0]) // (a[2] + a[3]))
	else:
		print(-1)
	t -= 1


t = int(input())
while t:
	t -= 1
	(x, y, a, b) = map(int, input().split())
	res = y - x
	val = a + b
	if res % val != 0:
		print(-1)
	else:
		print(res // val)


for m in range(int(input())):
	xyab = list(map(int, input().split()))
	if (xyab[1] - xyab[0]) % (xyab[2] + xyab[3]) != 0:
		print(-1)
	else:
		print(int((xyab[1] - xyab[0]) // (xyab[2] + xyab[3])))


def check(x, y, a, b):
	time = (y - x) % (a + b)
	if time:
		return -1
	return (y - x) // (a + b)
t = int(input())
for i in range(t):
	(x, y, a, b) = (int(x) for x in input().split())
	print(check(x, y, a, b))


for i in range(int(input())):
	(x, y, a, b) = map(int, input().split())
	if int((y - x) / (a + b)) == (y - x) / (a + b):
		print((y - x) // (a + b))
		continue
	print(-1)


t = int(input())
for _ in range(t):
	arr = list(map(int, input().strip().split()))
	x = arr[0]
	y = arr[1]
	a = arr[2]
	b = arr[3]
	less = (y - x) % (a + b)
	if less:
		print(-1)
	else:
		print((y - x) // (a + b))


no = int(input())
res = []
for i in range(no):
	(x, y, a, b) = map(int, input().split())
	if (y - x) % (a + b) == 0:
		res.append(int((y - x) / (a + b)))
	else:
		res.append(-1)
for i in res:
	print(i)


t = int(input())
while t > 0:
	(x, y, a, b) = [int(x) for x in input().split()]
	d = y - x
	s = int(d / (a + b))
	if s == float(d / (a + b)):
		print(s)
	else:
		print('-1')
	t = t - 1


from math import *
t = int(input())
for i in range(t):
	(x, y, a, b) = map(int, input().split())
	m = (y - x) / (a + b)
	if floor(m) != ceil(m):
		print(-1)
	else:
		print('%d' % m)


n = int(input())
for i in range(n):
	f = [int(x) for x in input().split()]
	if (f[1] - f[0]) % (f[2] + f[3]) == 0:
		print((f[1] - f[0]) // (f[2] + f[3]))
	else:
		print(-1)


import sys
for i in range(int(sys.stdin.readline())):
	temp = list(map(int, sys.stdin.readline().split()))
	x = temp[0]
	y = temp[1]
	a = temp[2]
	b = temp[3]
	if (x - y) % (a + b) == 0:
		print(int((y - x) / (a + b)))
	else:
		print('-1')


for _ in range(int(input())):
	(x, y, a, b) = map(int, input().split())
	n = 0
	steps = a + b
	pos = y - x
	if pos % steps == 0:
		print(pos // steps)
	else:
		print(-1)


T = int(input())
for _ in range(T):
	(x, y, a, b) = list(map(int, input().split()))
	t = abs(x - y) / (a + b)
	if t != int(t):
		t = -1
	print(int(t))


import sys, math
MOD = 998244353

def solve():
	(x, y, a, b) = map(int, input().split())
	if (y - x) % (a + b) == 0:
		return (y - x) // (a + b)
	else:
		return -1
for test in range(1, int(input()) + 1):
	print(solve())


for _ in [0] * int(input()):
	(x, y, a, b) = map(int, input().split())
	if not (y - x) % (a + b):
		print((y - x) // (a + b))
	else:
		print(-1)


t = int(input())
for i in range(t):
	(x, y, a, b) = tuple(map(int, input().split()))
	dist = y - x
	speed = a + b
	if dist // speed != dist / speed:
		print(-1)
	else:
		print(int(dist / speed))


t = int(input())
for qewqeq in range(t):
	(x, y, a, b) = map(int, input().split())
	f = (y - x) / (a + b)
	if f == int(f):
		print(int(f))
	else:
		print(-1)


T = int(input())
for i in range(1, T + 1):
	(x, y, a, b) = input().split()
	ans = (int(y) * 1.0 - int(x) * 1.0) / (int(a) + int(b))
	ans_ = int(ans)
	if ans == ans_:
		print(int(ans), end='\n')
	elif ans != ans_:
		print('-1', end='\n')


for _ in range(int(input())):
	(x, y, a, b) = map(int, input().split())
	print(['-1', (y - x) // (a + b)][(y - x) % (a + b) == 0])


t = int(input())
for i in range(t):
	(x, y, a, b) = map(int, input().split())
	count = 0
	temp = 0
	sum = a + b
	diff = y - x
	if diff % sum == 0:
		print(diff // sum)
	else:
		print('-1')


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

def I():
	return int(input())

def S():
	return str(input())

def L():
	return list(R())
from collections import Counter
import math
import sys
from itertools import permutations
import bisect
for _ in range(I()):
	(x, y, a, b) = R()
	print(['-1', (-x + y) // (a + b)][(-x + y) % (a + b) == 0])


n = int(input())
x = 0
y = 0
a = 0
b = 0
negetive = -1
for i in range(0, n):
	(x, y, a, b) = map(int, input().split())
	total_distant = a + b
	d = abs(x - y)
	t = d / total_distant
	if t % 2 > 0 and t % 2 < 1:
		print(negetive)
	elif t % 2 > 1 and t % 2 < 2:
		print(negetive)
	else:
		print(int(t))


def solve(x, y, a, b):
	d = y - x
	if d % (a + b) == 0:
		print(int(d / (a + b)))
	else:
		print('-1')
t = int(input())
for i in range(0, t):
	line1 = list(map(lambda x: int(x), input().split()))
	solve(line1[0], line1[1], line1[2], line1[3])


t = int(input())
for case in range(t):
	(x, y, a, b) = [int(s) for s in input().split(' ')]
	time = (y - x) / (a + b)
	if int(time) == time:
		print(int(time))
	else:
		print(-1)


def Solve():
	global ans
	(x, y, a, b) = map(int, input().split())
	s = y - x
	if s % (a + b) == 0:
		print(s // (a + b))
	else:
		print(-1)
n = int(input())
for _ in range(n):
	Solve()


import math
import sys
import re
for x in range(int(input())):
	(a, b, x, y) = map(int, input().rstrip().split())
	n = abs(a - b) // (x + y)
	if n * (x + y) == abs(a - b):
		print(n)
	else:
		print(-1)


for _ in range(int(input())):
	(x, y, a, b) = map(int, input().split())
	(p, q) = divmod(abs(x - y), a + b)
	print(p if not q else -1)


import math, sys
from collections import Counter, defaultdict, deque
from sys import stdin, stdout
input = stdin.readline
lili = lambda : list(map(int, sys.stdin.readlines()))
li = lambda : list(map(int, input().split()))
I = lambda : int(input())
S = lambda : input().strip()
mod = 1000000007
for i in range(I()):
	(x, y, a, b) = li()
	k = y - x
	p = a + b
	if k % p == 0:
		print(k // p)
	else:
		print(-1)


t = int(input())
for i in range(t):
	(x, y, a, b) = map(int, input().split())
	test_value = y - x
	mod_value = a + b
	if test_value % mod_value == 0:
		print(test_value // mod_value)
	else:
		print('-1')


for _ in range(int(input())):
	(x, y, a, b) = map(int, input().split())
	num = y - x
	den = a + b
	if den != 0:
		if num % den == 0:
			print(num // den)
		else:
			print(-1)
	else:
		print(-1)


t = int(input())
for i in range(0, t):
	inp = list(input().split())
	if (int(inp[1]) - int(inp[0])) % (int(inp[2]) + int(inp[3])) == 0:
		z = (int(inp[1]) - int(inp[0])) / (int(inp[2]) + int(inp[3]))
		print(int(z))
	else:
		print(-1)


try:
	n = int(input())
	for _n in range(n):
		(a, b, c, d) = map(int, input().split())
		a = b - a
		c = c + d
		if a % c != 0:
			print(-1)
		else:
			print(a // c)
except:
	pass


t = int(input())
for i in range(t):
	(x, y, a, b) = map(int, input().split())
	num = y - x
	num2 = a + b
	if num % num2 != 0:
		print(-1)
	else:
		print(num // num2)


t = int(input(''))
while t > 0:
	(x, y, a, b) = input().split()
	x = int(x)
	y = int(y)
	a = int(a)
	b = int(b)
	dist = y - x
	gap = a + b
	if dist % gap == 0:
		p = dist // gap
		print(p)
	else:
		print(-1)
	t = t - 1


ans = []
for _ in range(int(input())):
	l = list(map(int, input().split(' ')))
	k = (l[1] - l[0]) % (l[2] + l[3])
	kk = (l[1] - l[0]) // (l[2] + l[3])
	if k == 0 and kk > 0:
		ans.append(kk)
	else:
		ans.append(-1)
print(*ans, sep='\n')


for ti in range(int(input())):
	(x, y, a, b) = [int(x) for x in input().split()]
	if (y - x) % (a + b) == 0:
		print((y - x) // (a + b))
	else:
		print('-1')


import sys
MIN_INPUT_LENGTH = 7

def rabbits_date(str):
	try:
		[x, y, a, b] = [int(number) for number in str.split(' ')]
		length = y - x
		speed = a + b
		if length % speed == 0:
			return length // speed
		else:
			return -1
	except:
		return -1
number_of_tests = int(input())
for line in sys.stdin:
	line = line.strip()
	if len(line) < MIN_INPUT_LENGTH:
		continue
	print(rabbits_date(line))


from sys import stdin
from math import ceil
mod = 1000000007
for _ in range(int(stdin.readline())):
	(x, y, a, b) = map(int, stdin.readline().split())
	if (y - x) % (a + b) == 0:
		print((y - x) // (a + b))
	else:
		print(-1)


n = 0
li = []

def func(x, y, a, b):
	if (y - x) % (a + b) != 0:
		return -1
	else:
		return (y - x) / (a + b)
n = int(input())
for i in range(n):
	(x, y, a, b) = input().split()
	(x, y, a, b) = (int(x), int(y), int(a), int(b))
	li.append(func(x, y, a, b))
for i in range(n):
	print(int(li[i]))


n = int(input())
for i in range(n):
	(x, y, z, p) = list(map(int, input().split()))
	if (y - x) % (z + p) == 0:
		print((y - x) // (z + p))
	else:
		print(-1)


def solve():
	(x, y, a, b) = [int(s) for s in input().strip().split()]
	(q, r) = divmod(y - x, a + b)
	print(q if r == 0 else -1)

def main():
	for _ in range(int(input().strip())):
		solve()
main()


def problem1(s):
	x = s[0]
	y = s[1]
	a = s[2]
	b = s[3]
	if (y - x) % (a + b) == 0:
		return int((y - x) / (a + b))
	else:
		return -1
N = int(input())
for _ in range(N):
	s = list(map(lambda x: int(x), input().split(' ')))
	print(problem1(s))


def timeCalculator(x, y, a, b):
	secCount = 0
	if (y - x) % (a + b) == 0:
		secCount = (y - x) // (a + b)
		return secCount
	return -1
t = int(input())
while t > 0:
	firstline = list(map(int, input().split(' ')))
	x = firstline[0]
	y = firstline[1]
	a = firstline[2]
	b = firstline[3]
	print(timeCalculator(x, y, a, b))
	t -= 1


def met(array):
	return (array[1] - array[0]) / (array[2] + array[3])
n = int(input())
for i in range(n):
	cur = [int(i) for i in input().split()]
	if met(cur).is_integer():
		print(str(int(met(cur))))
	else:
		print(-1)


t = int(input())
while t > 0:
	(x, y, a, b) = [int(ele) for ele in input().split()]
	diff = y - x
	if diff % (a + b) == 0:
		print(int(diff / (a + b)))
	else:
		print(-1)
	t -= 1


import sys
input = sys.stdin.readline
T = int(input())
for _ in range(T):
	(x, y, a, b) = map(int, input().split())
	D = y - x
	q = D // (a + b)
	p = D % (a + b)
	if p:
		print(-1)
	else:
		print(q)


t = int(input())
for _ in range(t):
	(x, y, a, b) = list(map(int, input().split()))
	dist = y - x
	v = a + b
	if dist % v != 0:
		print(-1)
	else:
		print(dist // v)


t = int(input())
c = 1
while c <= t:
	(x, y, a, b) = input().split(' ')
	x = int(x)
	y = int(y)
	a = int(a)
	b = int(b)
	q = y - x
	w = a + b
	if q % w == 0:
		d = int(q / w)
	else:
		d = -1
	print(d)
	c += 1


def get_rabbit_meeting_step(first_rabbit_start_pos, second_rabbit_start_pos, first_rabbit_jump_distance, second_rabbit_jump_distance):
	if (second_rabbit_start_pos - first_rabbit_start_pos) % (first_rabbit_jump_distance + second_rabbit_jump_distance) != 0:
		return -1
	return (second_rabbit_start_pos - first_rabbit_start_pos) // (first_rabbit_jump_distance + second_rabbit_jump_distance)
data = [tuple(map(int, input().split())) for _ in range(int(input()))]
for it in data:
	print(get_rabbit_meeting_step(it[0], it[1], it[2], it[3]))


n = int(input())
answer = []
data = []
for i in range(0, n):
	data = list(map(int, input().split()))
	if (data[1] - data[0]) % (data[2] + data[3]) == 0:
		answer.append((data[1] - data[0]) / (data[2] + data[3]))
	else:
		answer.append(-1)
for i in range(0, n):
	print(int(answer[i]))


import sys
numCases = int(input())
for j in range(0, numCases):
	inputArray = input().split(' ')
	for (i, val) in enumerate(inputArray):
		inputArray[i] = int(val)
	bunXPos = inputArray[0]
	bunYPos = inputArray[1]
	bunXHop = inputArray[2]
	bunYHop = inputArray[3]
	distance = bunYPos - bunXPos
	hopLength = bunXHop + bunYHop
	hops = distance / hopLength
	if distance % hopLength == 0:
		print(int(hops))
	else:
		print(-1)


def main():
	import sys
	input = sys.stdin.readline
	t = int(input())
	for _ in range(t):
		(x, y, a, b) = map(int, input().split())
		d = y - x
		if d % (a + b) == 0:
			print(d // (a + b))
		else:
			print(-1)
main()


n = int(input())
a = []
for i in range(n):
	b = list(map(int, input().split()))
	if (b[1] - b[0]) % (b[2] + b[3]) == 0:
		a.append((b[1] - b[0]) // (b[2] + b[3]))
	else:
		a.append(-1)
for i in a:
	print(i)


from math import ceil, floor

def inplst():
	return map(int, input().split())
for _ in range(int(input())):
	(x, y, a, b) = inplst()
	r = (y - x) / (a + b)
	print(floor(r) if ceil(r) == floor(r) else -1)


import sys

def rr():
	return sys.stdin.readline().rstrip()
rp = print

def print(*args, **kwargs):
	rp('DBG:# ', *args, **kwargs, file=sys.stderr)

def rri():
	return int(rr())

def rrl():
	return list(map(int, rr().split()))

def rrt():
	return tuple(map(int, rr().split()))

def rrle():
	return (line.rstrip() for line in sys.stdin.readlines())

def rrtl():
	return [tuple(map(int, l.split())) for l in rrle()]
from collections import defaultdict

def mus(d=lambda : 0):
	return defaultdict(lambda : defaultdict(d))

def dd0(d=lambda : 0):
	return defaultdict(d)

def ms(x, y, d=0):
	return [[0] * y for i in range(x)]

def ar(x, d=0):
	return [d] * x

def ppm(m, n=0, x=0, y=0):
	print('\n'.join(('\t'.join((str(m[j][i]) for j in range(y or n))) for i in range(x or n))))

def ppa(a, n):
	print('\t'.join(map(str, a[0:n])))

def ppl(a=0, x=[1]):
	x[0] = a or x[0] + 1
	print('-' + '- -' * 14 + '-# ' + str(x[0] - 2) + ' #-' + '- -' * 14 + '-')

def fltn(a):
	(i for sub in a for i in sub)

def yn(x):
	return 'YES' if x else 'NO'

def cpc(arr):
	return zip(arr, arr[1:])
from itertools import accumulate
from itertools import groupby
from itertools import permutations

def grp(x, key=None):
	return ((i, sum((1 for _ in g))) for (i, g) in groupby(x, key=key))
import math

def rnar():
	return (*rrl(), rrl())

def rn():
	return (*rrl(),)

def dpp(a, b=''):
	print('#| {} |#:^ {} ^:'.format(a, b))

def str_join(i, sep=' '):
	return sep.join(map(str, i))
MOD17 = 10 ** 9 + 7

def read():
	return (*rrl(),)

def solve(x, y, a, b):
	dist = y - x
	if dist < 0:
		return -1
	jumps = dist // (a + b)
	if dist % (a + b) == 0:
		return jumps
	else:
		return -1
	return ans
test_count = 1
test_count = rri()
for _ in range(test_count):
	input_data = read()
	result = solve(*input_data)
	rp(result)


def main(x, y, a, b):
	q = (y - x) // (a + b)
	r = (y - x) % (a + b)
	if r == 0:
		return q
	else:
		return -1
t = int(input())
for _ in range(t):
	(x, y, a, b) = [int(x) for x in input().split()]
	print(main(x, y, a, b))


t = int(input())
for o in range(t):
	(a, b, n, m) = map(int, input().split())
	x = b - a
	y = n + m
	if x % y != 0:
		print(-1)
	else:
		print(x // y)


t = int(input())
while t != 0:
	(x, y, a, b) = map(int, input().split())
	diff1 = y - x
	add1 = a + b
	if diff1 % add1 == 0:
		print(diff1 // add1)
	else:
		print(-1)
	t = t - 1


for i in range(int(input())):
	(s, o, n, a) = list(map(int, input().split()))
	if (o - s) % (a + n) == 0:
		print((o - s) // (a + n))
	else:
		print(-1)


import sys
import bisect
import heapq
from math import *
from collections import defaultdict as dd
from collections import deque
from collections import Counter as c
from itertools import combinations as comb
mod = pow(10, 9) + 7
mod2 = 998244353

def data():
	return sys.stdin.readline().strip()

def out(var):
	sys.stdout.write(var)

def l():
	return list(map(int, data().split()))

def sl():
	return list(map(str, data().split()))

def sp():
	return map(int, data().split())

def ssp():
	return map(str, data().split())

def l1d(n, val=0):
	return [val for i in range(n)]

def l2d(n, m, val=0):
	return [[val for i in range(n)] for j in range(m)]
for _ in range(int(input())):
	(x, y, a, b) = map(int, input().split())
	if (y - x) % (a + b) == 0:
		print((y - x) // (a + b))
	else:
		print(-1)


t = int(input())
resultList = []
while t > 0:
	(x, y, a, b) = [int(i) for i in input().split()]
	n = (y - x) / (a + b)
	if n == int(n):
		resultList.append(int(n))
	else:
		resultList.append(-1)
	t -= 1
for result in resultList:
	print(result)


def solve(x, y, a, b):
	num = y - x
	den = a + b
	t_f = num / den
	t_i = num // den
	return t_i if t_f == t_i else -1
for i in range(int(input())):
	(x, y, a, b) = map(int, input().split())
	print(solve(x, y, a, b))


from math import ceil
for q in range(int(input())):
	(x, y, a, b) = map(int, input().split())
	k = (y - x) / (b + a)
	if k >= 0 and int(k) == ceil(k):
		print(int(k))
	else:
		print(-1)


from collections import OrderedDict
from math import fabs
d = OrderedDict()
t = int(input())
while t:
	t -= 1
	(x, y, a, b) = [int(i) for i in input().split()]
	if fabs(x - y) % (a + b):
		print(-1)
	else:
		print(int(fabs(x - y) // (a + b)))


import sys
import os
import time
import collections
from collections import Counter, deque
import itertools
import math
import timeit
import random
from io import BytesIO, IOBase

def sieve(n):
	if n < 2:
		return list()
	prime = [True for _ in range(n + 1)]
	p = 3
	while p * p <= n:
		if prime[p]:
			for i in range(p * 2, n + 1, p):
				prime[i] = False
		p += 2
	r = [2]
	for p in range(3, n + 1, 2):
		if prime[p]:
			r.append(p)
	return r

def divs(n, start=1):
	divisors = []
	for i in range(start, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n / i == i:
				divisors.append(i)
			else:
				divisors.extend([i, n // i])
	return divisors

def divn(n, primes):
	divs_number = 1
	for i in primes:
		if n == 1:
			return divs_number
		t = 1
		while n % i == 0:
			t += 1
			n //= i
		divs_number *= t

def flin(d, x, default=-1):
	left = right = -1
	for i in range(len(d)):
		if d[i] == x:
			if left == -1:
				left = i
			right = i
	if left == -1:
		return (default, default)
	else:
		return (left, right)

def ceil(n, k):
	return n // k + (n % k != 0)

def ii():
	return int(input())

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

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

def lcm(a, b):
	return abs(a * b) // math.gcd(a, b)

def prr(a, sep=' '):
	print(sep.join(map(str, a)))

def dd():
	return collections.defaultdict(int)

def ddl():
	return collections.defaultdict(list)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
for _ in range(ii()):
	(x, y, a, b) = mi()
	if (y - x) % (a + b) == 0:
		print((y - x) // (a + b))
	else:
		print(-1)


t = int(input())
for i in range(t):
	l = list(map(int, input().split()))
	a = l[0]
	b = l[1]
	c = l[2]
	d = l[3]
	if (b - a) % (c + d) == 0:
		print(int((b - a) / (c + d)))
	else:
		print(-1)


import math
t = int(input())
for i in range(t):
	(x, y, a, b) = [int(j) for j in input().split()[:4]]
	v = y - x
	w = a + b
	f1 = abs(v // w)
	f2 = math.ceil(v / w)
	if f1 == f2:
		print(f1)
	else:
		print(-1)


t = int(input())
for _ in range(t):
	(n, m, a, b) = map(int, input().split())
	p = abs(n - m)
	q = a + b
	if p % q == 0:
		print(p // q)
	else:
		print('-1')


for i in range(int(input())):
	(s0, s1, p0, p1) = map(int, input().split())
	if (s1 - s0) % (p0 + p1):
		print(-1)
	else:
		print((s1 - s0) // (p0 + p1))


test = int(input())
for _ in range(test):
	(x, y, a, b) = map(int, input().split())
	d = y - x
	s = a + b
	if not d % s:
		print(d // s)
	else:
		print(-1)


t = int(input())
h = []
for i in range(t):
	x = input()
	x = x.split(' ')
	d = ((int(x[1]) - int(x[0])) ** 2) ** 0.5
	e = int(x[2]) + int(x[3])
	if d / e == d // e:
		h.append(d / e)
	else:
		h.append(-1)
for i in h:
	print(int(i))


t = int(input())
result = []
for _ in range(t):
	(x, y, a, b) = input().split(' ')
	x = int(x)
	y = int(y)
	a = int(a)
	b = int(b)
	if (y - x) % (a + b) == 0:
		result.append((y - x) // (a + b))
	else:
		result.append(-1)
for item in result:
	print(item)


for i in range(int(input())):
	(a, b, k1, k2) = map(int, input().split())
	if (b - a) % (k1 + k2) == 0:
		print((b - a) // (k1 + k2))
	else:
		print('-1')


import sys
reader = (line.rstrip() for line in sys.stdin)
input = reader.__next__
t = int(input())
for _ in range(t):
	(x, y, a, b) = map(int, input().split())
	(ans, rem) = divmod(y - x, a + b)
	if rem > 0:
		print(-1)
	else:
		print(ans)


n = int(input())
k = []
for i in range(n):
	(x, y, a, b) = input().split(' ')
	x = int(x)
	y = int(y)
	a = int(a)
	b = int(b)
	c = (y - x) / (a + b)
	if c % 1 == 0:
		k.append(int(c))
	else:
		k.append(-1)
for i in k:
	print(i)


def main():
	t = int(input())
	for _ in range(t):
		(x, y, a, b) = map(int, input().split())
		i = (y - x) // (a + b)
		if x + a * i == y - b * i:
			print(i)
		else:
			print(-1)
	return
main()


import atexit
import io
import sys
import math
from collections import defaultdict, Counter
t = int(input())
for i in range(t):
	(x, y, a, b) = map(int, input().split())
	if abs(x - y) % (a + b) == 0:
		print(abs(x - y) // (a + b))
	else:
		print(-1)


for u in range(int(input())):
	(x, y, a, b) = map(int, input().split())
	if (x - y) % (a + b) == 0:
		print((y - x) // (a + b))
	else:
		print(-1)


arr = []
test_cases = int(input(''))
for x in range(test_cases):
	a = []
	a = list(map(int, input().split()))
	arr.append(a)
for t in range(test_cases):
	x = arr[t][0]
	y = arr[t][1]
	a = arr[t][2]
	b = arr[t][3]
	if abs(y - x) % (a + b) == 0:
		if abs(y - x) % (a + b) == 0:
			print(int((y - x) / (a + b)))
	else:
		print('-1')


n = int(input())
while n > 0:
	b = list(map(int, input().split()))
	if (b[1] - b[0]) % (b[2] + b[3]) == 0:
		print(int((b[1] - b[0]) / (b[2] + b[3])))
	else:
		print(-1)
	n -= 1


n = int(input())
k = 0
while k < n:
	s = 1
	(rabbit1, rabbit2, rabbitspeed1, rabbitspeed2) = map(int, input().split())
	c = rabbitspeed1 + rabbitspeed2
	b = rabbit2 - rabbit1
	if b % c == 0:
		print(b // c)
	else:
		print(-1)
	k = k + 1


for i in [*open(0)][1:]:
	(x, y, a, b) = map(int, i.split())
	t = (y - x) / (a + b)
	print(-1 if t % 1 else int(t))


T = int(input())
for i in range(1, T + 1):
	(x, y, a, b) = input().split()
	o1 = (int(y) * 1.0 - int(x) * 1.0) / (int(a) + int(b))
	o2 = int(o1)
	if o1 == o2:
		print(o2)
	elif o1 != o2:
		print('-1')


tc = int(input())
for T in range(tc):
	(x, y, a, b) = map(int, input().split())
	(s, dif) = (a + b, y - x)
	if dif % s == 0:
		res = dif // s
	else:
		res = -1
	print(res)


import sys
input = sys.stdin.readline
cases = int(input())
for case in range(cases):
	(x, y, a, b) = map(int, input().split())
	if (y - x) % (a + b) == 0:
		print((y - x) // (a + b))
	else:
		print(-1)


import sys
reader = (s.rstrip() for s in sys.stdin)
input = reader.__next__

def solve():
	(x, y, a, b) = map(int, input().split())
	if y - x >= 0 and (y - x) % (a + b) == 0:
		ans = (y - x) // (a + b)
	else:
		ans = -1
	print(ans)
t = int(input())
for i in range(t):
	solve()


def test_case(x, y, a, b):
	if x > y:
		print(-1)
		return
	low = 0
	high = 1000000010
	while low + 1 < high:
		mid = (low + high) // 2
		gap = y - b * mid - (x + a * mid)
		if gap == 0:
			print(mid)
			return
		elif gap < 0:
			high = mid
		else:
			low = mid
	if y - b * low == x + a * low:
		print(low)
	else:
		print(-1)
cases = int(input())
for t in range(cases):
	(x, y, a, b) = [int(a) for a in input().split()]
	test_case(x, y, a, b)


t = int(input())
xyab = [list(map(int, input().split())) for _ in range(t)]
for xyabi in xyab:
	if (xyabi[1] - xyabi[0]) % (xyabi[2] + xyabi[3]) == 0:
		print((xyabi[1] - xyabi[0]) // (xyabi[2] + xyabi[3]))
	else:
		print(-1)


import math

def change_char(s, p, r):
	return s[:p] + r + s[p + 1:]
test = int(input())
while test > 0:
	(x, y, j1, j2) = map(int, input().split())
	distance = (y - x) / (j1 + j2)
	i = int(distance)
	print(i if i == distance else -1)
	test -= 1


t = int(input())
for _ in range(t):
	(x, y, a, b) = map(int, input().split())
	x1 = abs(y - x) // (a + b)
	if abs(y - x) % (a + b) == 0:
		print(x1)
	else:
		print('-1')


for _ in range(int(input())):
	(x, y, a, b) = [int(i) for i in input().split()]
	if x > y:
		print(-1)
	elif (y - x) % (a + b) == 0:
		print((y - x) // (a + b))
	else:
		print(-1)


from sys import stdin
from collections import deque
mod = 10 ** 9 + 7
import sys
from queue import PriorityQueue
from bisect import bisect_right
from bisect import bisect_left
from collections import defaultdict
from math import sqrt, factorial, gcd, log2, inf, ceil
import heapq
input = lambda : sys.stdin.readline().rstrip()
from sys import stdin, stdout
from heapq import heapify, heappush, heappop
from itertools import permutations
from math import factorial as f

def ncr(x, y):
	return f(x) // (f(y) * f(x - y))
t = int(input())
for _ in range(t):
	(x, y, a, b) = map(int, input().split())
	z = y - x + a + b
	if z % (a + b) == 0:
		print(z // (a + b) - 1)
	else:
		print(-1)


n = int(input())
while n != 0:
	(a, b, c, d) = map(int, input().split())
	b = b - a
	d = d + c
	if b % d == 0:
		print(b // d)
	else:
		print(-1)
	n = n - 1


from sys import stdin, stdout
from math import gcd, sqrt
from collections import deque
input = stdin.readline
R = lambda : map(int, input().split())
I = lambda : int(input())
S = lambda : input().rstrip('\n')
L = lambda : list(R())
P = lambda x: stdout.write(x)
hg = lambda x, y: (y + x - 1) // x * x
pw = lambda x: 1 if x == 1 else 1 + pw(x // 2)
chk = lambda x: chk(x // 2) if not x % 2 else True if x == 1 else False
for _ in range(I()):
	(x, y, a, b) = R()
	if (y - x) % (a + b):
		print(-1)
	else:
		print((y - x) // (a + b))


l1 = []
x = int(input())
for i in range(x):
	l = list(map(int, input().split()))
	c = (l[1] - l[0]) / (l[2] + l[3])
	if (l[1] - l[0]) % (l[2] + l[3]) == 0:
		l1.append(int(c))
	else:
		l1.append(-1)
for i in l1:
	print(i)


n = int(input())
for i in range(n):
	g = list(map(int, input().split(' ')))
	m = (g[1] - g[0]) / (g[2] + g[3])
	(i, d) = divmod(m, 1)
	if d == 0:
		print(int(m))
	else:
		print('-1')


INF = 10 ** 10

def main():
	(x, y, a, b) = get_list()
	if (y - x) % (a + b) == 0:
		print((y - x) // (a + b))
	else:
		print(-1)
import sys
from collections import defaultdict, Counter
out = []
get_int = lambda : int(input())
get_list = lambda : list(map(int, input().split()))
[main() for _ in range(int(input()))]
print(*out, sep='\n')


def function(x, y, a, b):
	s = y - x
	q = a + b
	r = s // q
	if x + r * a != y - r * b:
		return -1
	return r
t = int(input())
outputs = []
for _ in range(t):
	(x, y, a, b) = map(int, input().split())
	print(function(x, y, a, b))


t = int(input())
for k in range(t):
	(x, y, a, b) = map(int, input().split())
	ans = lambda x, y, a, b: (y - x) / (a + b)
	fin = ans(x, y, a, b)
	if fin % 1 == 0:
		print(int(fin))
	else:
		print(-1)


t = int(input())
while t:
	t -= 1
	(x, y, a, b) = [int(i) for i in input().split()]
	y = y - x
	a = a + b
	if y % a:
		print(-1)
	else:
		print(y // a)


t = int(input())
for case in range(t):
	data = [int(x) for x in input().split(' ')]
	d = data[1] - data[0]
	a = data[2]
	b = data[3]
	if d % (a + b) != 0:
		print(-1)
	else:
		n = int(d / (a + b))
		print(n)


for s in [*open(0)][1:]:
	(x, y, a, b) = map(int, s.split())
	print(-1 if (y - x) % (a + b) else (y - x) // (a + b))


from math import gcd
for _ in range(int(input())):
	(x, y, a, b) = map(int, input().split())
	dis = abs(x - y)
	if dis % (a + b):
		print(-1)
	else:
		print(dis // (a + b))


n = int(input())
for _ in range(n):
	tmp = input().strip()
	(x, y, a, b) = list(map(int, tmp.split()))
	b = -b
	if a == b:
		print(-1)
	else:
		t = (y - x) // (a - b)
		if t > 0 and (y - x) % (a - b) == 0:
			print(t)
		else:
			print(-1)


import math
t = int(input())
for i in range(0, t):
	(x, y, a, b) = list(map(int, input().split(' ')))
	d = y - x
	s = a + b
	k = d / s
	if k - math.floor(k) != 0:
		print(-1)
	else:
		print(int(k))


def solve(x, y, a, b):
	s = y - x
	v = a + b
	if s % v == 0:
		print(int(s / v))
	else:
		print(-1)
t = int(input())
for _ in range(t):
	(x, y, a, b) = map(int, input().split())
	solve(x, y, a, b)


t = int(input())
while t:
	t -= 1
	(x, y, a, b) = list(map(int, input().split()))
	num = y - x
	denom = a + b
	if num % denom == 0:
		print(num // denom)
	else:
		print(-1)


n = int(input())
no_of_lines = n
lines = ''
for i in range(no_of_lines):
	lines += input() + '\n'
templines = lines.split('\n')
temparr = [list(map(int, templines[i].split(' '))) for i in range(n)]
for i in range(no_of_lines):
	x = temparr[i][0]
	y = temparr[i][1]
	a = temparr[i][2]
	b = temparr[i][3]
	if x > y:
		print(-1)
	elif (y - x) % (a + b) == 0:
		print((y - x) // (a + b))
	else:
		print(-1)


n = int(input())
lst = list()
for i in range(n):
	st = list(input().split(' '))
	dis = int(st[1]) - int(st[0])
	a = int(st[2])
	b = int(st[3])
	u = dis / (a + b)
	if dis % (a + b) == 0:
		lst.append(int(u))
	else:
		lst.append(-1)
for i in lst:
	print(i)


t = int(input())
while t > 0:
	(x, y, a, b) = map(int, input().split())
	A = y - x
	B = a + b
	if A % B == 0:
		print(A // B)
	else:
		print(-1)
	t -= 1


for __ in range(int(input())):
	(x, y, a, b) = map(int, input().split())
	z = y - x
	c = a + b
	print(-1 if z % c else z // c)


for i in range(int(input())):
	(x, y, a, b) = map(int, input().split())
	(s1, s2) = (y - x, a + b)
	print(-1 if s1 % s2 else s1 // s2)


import sys

def fastio():
	from io import StringIO
	from atexit import register
	global input
	sys.stdin = StringIO(sys.stdin.read())
	input = lambda : sys.stdin.readline().rstrip('\r\n')
	sys.stdout = StringIO()
	register(lambda : sys.__stdout__.write(sys.stdout.getvalue()))
fastio()

def debug(*var, sep=' ', end='\n'):
	print(*var, file=sys.stderr, end=end, sep=sep)
INF = 10 ** 20
MOD = 10 ** 9 + 7
I = lambda : list(map(int, input().split()))
from math import gcd
from math import ceil
from collections import defaultdict as dd, Counter
from bisect import bisect_left as bl, bisect_right as br
(t,) = I()
while t:
	t -= 1
	(x, y, a, b) = I()
	k = (y - x) // (a + b)
	ans = -1
	if k * a + x == y - k * b:
		ans = k
	print(ans)


a = int(input())
for i in range(a):
	diff = 0
	s = input().split(' ')
	x = int(s[0])
	y = int(s[1])
	a = int(s[2])
	b = int(s[3])
	NET_SUM = a + b
	if x > y:
		diff = x - y
	else:
		diff = y - x
	if diff % NET_SUM == 0 and diff >= NET_SUM:
		print(diff // NET_SUM)
	else:
		print(-1)


n = int(input())
for i in range(n):
	(x, y, a, b) = map(int, input().split())
	r = (y - x) // (a + b)
	if (y - x) % (a + b) == 0 and r >= 0:
		print(r)
	else:
		print(-1)


t = int(input())
while t > 0:
	s = input().split()
	x = int(s[0])
	y = int(s[1])
	a = int(s[2])
	b = int(s[3])
	s1 = (y - x) / (a + b)
	s2 = (y - x) // (a + b)
	if s1 == s2:
		print(int(s2))
	else:
		print('-1')
	t -= 1


n = int(input())
for i in range(n):
	xyab = list(map(int, input().split()))
	x = xyab[0]
	y = xyab[1]
	a = xyab[2]
	b = xyab[3]
	if (y - x) % (a + b) == 0:
		print((y - x) // (a + b))
	else:
		print(-1)


for i in range(int(input())):
	(X, Y, A, B) = [int(i) for i in input().split(' ')]
	if (Y - X) % (A + B) == 0:
		print((Y - X) // (A + B))
	else:
		print(-1)


from sys import stdin, gettrace
if not gettrace():

	def input():
		return next(stdin)[:-1]

def main():

	def solve():
		(x, y, a, b) = map(int, input().split())
		if (y - x) % (a + b) == 0:
			print((y - x) // (a + b))
		else:
			print(-1)
	q = int(input())
	for _ in range(q):
		solve()
main()


t = int(input())
for __ in range(t):
	(n, m, p, q) = map(int, input().split())
	print((m - n) // (p + q)) if (m - n) % (p + q) == 0 else print('-1')


while True:
	try:
		t = eval(input())
		for i in range(t):
			(x, y, a, b) = map(int, input().split())
			if (y - x) % (b + a) == 0:
				print((y - x) // (a + b))
			else:
				print(-1)
	except:
		break


def solve():
	t = int(input())
	for i in range(t):
		(x, y, a, b) = [int(s) for s in input().split()]
		if y - x >= a + b and (y - x) % (a + b) == 0:
			print((y - x) // (a + b))
		else:
			print(-1)
solve()


import sys

def test_simultaneously(x, y, a, b):
	distance = y - x
	step_length = a + b
	seconds = int(distance / step_length)
	if distance == step_length * seconds:
		return seconds
	else:
		return -1

def solve():
	total_cases = None
	cases = []
	left_cases = None
	for line in sys.stdin:
		if total_cases is None:
			total_cases = int(line.strip())
			left_cases = total_cases
		else:
			cases.append(line.split(' '))
			left_cases -= 1
			if left_cases == 0:
				break
	for case in cases:
		print(test_simultaneously(int(case[0]), int(case[1]), int(case[2]), int(case[3])))
solve()


for cs in range(int(input())):
	(x, y, a, b) = map(int, input().split())
	res = int((y - x) / (a + b))
	if res > 0 and int(res * (a + b)) == int(y - x):
		print(int(res))
	else:
		print(-1)


from sys import stdin, stdout
from collections import deque
T = int(stdin.readline())
M = 1000000007

def modInverse(a, m):
	m0 = m
	y = 0
	x = 1
	if m == 1:
		return 0
	while a > 1:
		q = a // m
		t = m
		m = a % m
		a = t
		t = y
		y = x - q * y
		x = t
	if x < 0:
		x = x + m0
	return x
for i in range(T):
	(x, y, a, b) = map(int, stdin.readline().split())
	if (y - x) % (a + b) == 0:
		print((y - x) // (a + b))
	else:
		print(-1)


q = int(input())
while q != 0:
	q -= 1
	l = input().split()
	x = int(l[0])
	y = int(l[1])
	a = int(l[2])
	b = int(l[3])
	if (y - x) % (a + b) == 0:
		print(int((y - x) // (a + b)))
	else:
		print(-1)


t = int(input())
for i in range(t):
	w = list(map(int, input().split(' ')))
	c = w[2] + w[3]
	resi = w[1] - w[0]
	if resi % c == 0:
		print(resi // c)
	else:
		print(-1)


import sys
input = sys.stdin.readline
cases = int(input())
for case in range(cases):
	(x, y, a, b) = map(int, input().split())
	(lo, hi) = (0, 1000000001)
	ans = -1
	while lo < hi:
		mid = lo + hi >> 1
		if x + a * mid == y - b * mid:
			ans = mid
			break
		if x + a * mid > y - b * mid:
			hi = mid - 1
		else:
			lo = mid + 1
	if x + a * lo == y - b * lo:
		ans = lo
	print(ans)


from copy import copy
from math import *

def arr_float_inp():
	return [float(s) for s in input().split()]

def arr_int_inp():
	return [int(s) for s in input().split()]

def int_inp():
	return int(input())

def float_inp():
	return float(input())

def comp(a):
	return a[0]

def gcd(a, b):
	if b != 0:
		return gcd(b, a % b)
	else:
		return a

def lcm(a, b):
	a / gcd(a, b) * b
for _ in range(int_inp()):
	(x, y, a, b) = arr_int_inp()
	out = (y - x) / (a + b)
	if out == int(out):
		print(int(out))
	else:
		print(-1)


inp = lambda : map(int, input().split(' '))
t = int(input())
for _ in range(t):
	(x, y, a, b) = inp()
	diff = y - x
	if diff % (b + a) == 0:
		print(diff // (b + a))
	else:
		print(-1)


def rabit(numList):
	i = (numList[1] - numList[0]) / (numList[2] + numList[3])
	if i - int(i) == 0.0:
		return int(i)
	return -1
numberOfTestCase = int(input())
for i in range(numberOfTestCase):
	numList = list(map(int, input().strip().split()))[:4]
	print(rabit(numList))


import os
import sys
from math import *
from collections import *
from fractions import *
from bisect import *
from heapq import *
from io import BytesIO, IOBase

def vsInput():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def value():
	return tuple(map(int, input().split()))

def array():
	return [int(i) for i in input().split()]

def Int():
	return int(input())

def Str():
	return input()

def arrayS():
	return [i for i in input().split()]
for _ in range(Int()):
	(x, y, a, b) = value()
	sec = a + b
	dist = y - x
	if dist % sec == 0:
		print(dist // sec)
	else:
		print(-1)


import math
from collections import *
import sys
from functools import reduce

def get_ints():
	return map(int, input().strip().split())

def get_list():
	return list(get_ints())

def get_string():
	return list(input().strip().split())

def printxsp(*args):
	return print(*args, end='')

def printsp(*args):
	return print(*args, end=' ')
UGLYMOD = int(1000000000.0) + 7
SEXYMOD = 998244353
MAXN = int(100000.0)
for _testcases_ in range(int(input())):
	(x, y, a, b) = get_ints()
	print('-1' if (y - x) % (a + b) else (y - x) // (a + b))


import sys
import math
import bisect
from sys import stdin, stdout
from math import gcd, floor, sqrt, log2, ceil, pi, sin, cos, acos, atan
from collections import defaultdict as dd
from bisect import bisect_left as bl, bisect_right as br
from bisect import insort
from collections import Counter
from collections import deque
from heapq import heappush, heappop, heapify
from itertools import permutations, combinations
mod = int(1000000000.0) + 7
ip = lambda : int(stdin.readline())
inp = lambda : map(int, stdin.readline().split())
ips = lambda : stdin.readline().rstrip()
out = lambda x: stdout.write(str(x) + '\n')
t = ip()
for _ in range(t):
	(x, y, a, b) = inp()
	if (y - x) % (a + b) == 0:
		ans = (y - x) // (a + b)
	else:
		ans = -1
	out(ans)


import sys
input = sys.stdin.readline
for _ in range(int(input().strip())):
	(x, y, a, b) = list(map(int, input().strip().split()))
	n = (y - x) / (a + b)
	if n == int(n):
		print(int(n))
	else:
		print(-1)


m = int(input())
l = []
for i in range(m):
	(a, b, c, d) = map(int, input().split())
	d = (b - a) / (c + d)
	if d == int(d):
		l.append(int(d))
	else:
		l.append(-1)
for i in l:
	print(i)


from collections import defaultdict as dd
from collections import Counter as ccd
from itertools import permutations as pp
from itertools import combinations as cc
from random import randint as rd
from bisect import bisect_left as bl
from bisect import bisect_right as br
import heapq as hq
from math import gcd
mod = pow(10, 9) + 7

def inp(flag=0):
	if flag == 0:
		return list(map(int, input().strip().split(' ')))
	else:
		return int(input())
t = inp(1)
while t:
	t -= 1
	(x1, x2, v1, v2) = inp()
	v2 *= -1
	if v2 - v1 != 0 and abs(x1 - x2) % abs(v2 - v1) == 0:
		print((x1 - x2) // (v2 - v1))
	else:
		print(-1)


n = int(input())
c = []
for i in range(n):
	c.append(list(map(int, input().replace('\n', '').split(' '))))
for i in range(n):
	if c[i][0] > c[i][1] or (c[i][1] - c[i][0]) % (c[i][2] + c[i][3]) is not 0:
		print('-1')
	else:
		print(int((c[i][1] - c[i][0]) / (c[i][2] + c[i][3])))


I = input
for _ in [0] * int(I()):
	(a, b, c, d) = map(int, I().split())
	n = (b - a) % (c + d)
	m = (b - a) / (c + d)
	print(int(m) if n == 0 else -1)


import math, itertools, fractions, heapq, collections, bisect, sys, queue, copy
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return [int(x) for x in sys.stdin.readline().split()]

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def LS():
	return sys.stdin.readline().split()

def S():
	return input()

def main():
	n = I()
	ans = []
	for _ in range(n):
		(a, b, c, d) = LI()
		x = b - a
		if x < 0:
			ans.append(-1)
		else:
			y = c + d
			if x % y != 0:
				ans.append(-1)
			else:
				ans.append(x // y)
	for x in ans:
		print(x)
main()


t = int(input())
count = 0
result = []
while count < t:
	n = input()
	(x, y, a, b) = n.split()
	dist = int(y) - int(x)
	dist_cover = int(a) + int(b)
	if dist % dist_cover == 0:
		result.append(dist // dist_cover)
	else:
		result.append('-1')
	count += 1
for x in result:
	print(x)


from sys import stdin, stderr

def rl():
	return [int(w) for w in stdin.readline().split()]
(t,) = rl()
for _ in range(t):
	(x, y, a, b) = rl()
	d = y - x
	v = a + b
	print(d // v if d % v == 0 else -1)


def solve_case():
	(x, y, a, b) = get([int])
	relative = a + b
	distance = y - x
	if distance % relative != 0:
		return -1
	return distance // relative

def get(x):
	if isinstance(x, list):
		return list(map(x[0], input().strip().split()))
	return x(input().strip())
for _ in range(get(int)):
	print(solve_case())


t = int(input())
for _ in range(t):
	(x, y, a, b) = map(int, input().split())
	sec = (y - x) / (a + b)
	if sec * 10 % 10 == 0:
		print(int(sec))
	else:
		print(-1)


def main():
	for _ in range(int(input())):
		(x, y, a, b) = map(int, input().split())
		n = abs(x - y) / (a + b)
		print(int(n) if n.is_integer() else -1)
main()


def solve(X, Y, A, B):
	(d, r) = divmod(Y - X, A + B)
	if r == 0:
		return d
	else:
		return -1

def __starting_point():
	(T,) = list(map(int, input().split()))
	for t in range(T):
		(X, Y, A, B) = list(map(int, input().split()))
		ans = solve(X, Y, A, B)
		print(ans)
__starting_point()


q = int(input())
for i in range(q):
	(x, y, a, b) = map(int, input().split())
	if x > y:
		print(-1)
		continue
	if abs(x - y) % (a + b) == 0:
		print(abs(x - y) // (a + b))
	else:
		print(-1)


for _ in range(int(input())):
	(x, y, a, b) = map(int, input().split())
	(div, mod) = divmod(y - x, a + b)
	if mod:
		print('-1')
	else:
		print(div)


import sys
import math
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	(x, y, a, b) = map(int, input().split())
	curr = (y - x) / (a + b)
	if curr == int(curr):
		print(int(curr))
	else:
		print(-1)


t = int(input())
for _ in range(t):
	(x, y, a, b) = [int(i) for i in input().split()]
	dist = y - x
	den = a + b
	if dist % den != 0:
		print(-1)
	else:
		print(dist // den)


import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub
sys.setrecursionlimit(100000)
input = sys.stdin.readline
INF = 2 ** 62 - 1

def read_int():
	return int(input())

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

def read_float():
	return float(input())

def read_float_n():
	return list(map(float, input().split()))

def read_str():
	return input().strip()

def read_str_n():
	return list(map(str, input().split()))

def error_print(*args):
	print(*args, file=sys.stderr)

def mt(f):
	import time

	def wrap(*args, **kwargs):
		s = time.time()
		ret = f(*args, **kwargs)
		e = time.time()
		error_print(e - s, 'sec')
		return ret
	return wrap

def slv(X, Y, A, B):
	Z = Y - X
	C = A + B
	if Z % C == 0:
		return Z // C
	return -1

def main():
	T = read_int()
	for _ in range(T):
		(X, Y, A, B) = read_int_n()
		print(slv(X, Y, A, B))
main()


t = int(input())
for i in range(t):
	l1 = [int(j) for j in input().split(' ')]
	c = l1[1] - l1[0]
	d = l1[2] + l1[3]
	if c % d != 0:
		print('-1')
	else:
		print(c // d)


import sys
from sys import stdin, stdout
import bisect
import math
import heapq

def modinv(n, p):
	return pow(n, p - 2, p)

def cin():
	return map(int, sin().split())

def ain():
	return list(map(int, sin().split()))

def sin():
	return input()

def inin():
	return int(input())
import math

def Divisors(n):
	l = []
	for i in range(1, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n // i == i:
				l.append(i)
			else:
				l.append(i)
				l.append(n // i)
	return l

def main():
	t = inin()
	for _ in range(t):
		(a, b, x, y) = cin()
		x = y + x
		b = b - a
		if b % x == 0:
			print(b // x)
		else:
			print(-1)
py2 = round(0.5)
if py2:
	from future_builtins import ascii, filter, hex, map, oct, zip
	range = xrange
import os, sys
from io import IOBase, BytesIO
BUFSIZE = 8192

class FastIO(BytesIO):
	newlines = 0

	def __init__(self, file):
		self._file = file
		self._fd = file.fileno()
		self.writable = 'x' in file.mode or 'w' in file.mode
		self.write = super(FastIO, self).write if self.writable else None

	def _fill(self):
		s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
		self.seek((self.tell(), self.seek(0, 2), super(FastIO, self).write(s))[0])
		return s

	def read(self):
		while self._fill():
			pass
		return super(FastIO, self).read()

	def readline(self):
		while self.newlines == 0:
			s = self._fill()
			self.newlines = s.count(b'\n') + (not s)
		self.newlines -= 1
		return super(FastIO, self).readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.getvalue())
			(self.truncate(0), self.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		if py2:
			self.write = self.buffer.write
			self.read = self.buffer.read
			self.readline = self.buffer.readline
		else:
			self.write = lambda s: self.buffer.write(s.encode('ascii'))
			self.read = lambda : self.buffer.read().decode('ascii')
			self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
import sys

class ostream:

	def __lshift__(self, a):
		sys.stdout.write(str(a))
		return self
cout = ostream()
endl = '\n'

def readnumbers(zero=0):
	conv = ord if py2 else lambda x: x
	A = []
	numb = zero
	sign = 1
	i = 0
	s = sys.stdin.buffer.read()
	try:
		while True:
			if s[i] >= b'0'[0]:
				numb = 10 * numb + conv(s[i]) - 48
			elif s[i] == b'-'[0]:
				sign = -1
			elif s[i] != b'\r'[0]:
				A.append(sign * numb)
				numb = zero
				sign = 1
			i += 1
	except:
		pass
	if s and s[-1] >= b'0'[0]:
		A.append(sign * numb)
	return A
main()


def answer():
	n = int(input())
	while n:
		a = [int(x) for x in input().split()]
		(x, y, a, b) = (a[0], a[1], a[2], a[3])
		if (y - x) / (a + b) == int((y - x) / (a + b)):
			print(int((y - x) / (a + b)))
		else:
			print(-1)
		n -= 1
answer()


T = int(input().strip())
debug = False
for t in range(T):
	(x, y, a, b) = map(int, input().split())
	if (y - x) % (a + b) == 0:
		print((y - x) // (a + b))
	else:
		print(-1)


n = int(input())
for i in range(n):
	(a, b, c, d) = map(int, input().split())
	s = (b - a) / (c + d)
	if int(s) == s:
		print(int(s))
	else:
		print(-1)


t = int(input())
for i in range(t):
	(x, y, a, b) = map(int, input().split())
	ras = max(x, y) - min(x, y)
	if ras % (a + b) != 0:
		print(-1)
	else:
		print(ras // (a + b))


Q = int(input())
for qq in range(Q):
	(x, y, a, b) = map(int, input().split())
	if (y - x) % (a + b):
		print(-1)
	else:
		print((y - x) // (a + b))


from collections import Counter
from collections import defaultdict
import math
import random
import heapq as hq
from math import sqrt
import sys
from functools import reduce

def input():
	return sys.stdin.readline().strip()

def iinput():
	return int(input())

def tinput():
	return input().split()

def rinput():
	return map(int, tinput())

def rlinput():
	return list(rinput())
mod = int(1000000000.0) + 7

def factors(n):
	return set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0)))

def solve():
	pass
for _ in range(iinput()):
	(x, y, a, b) = rinput()
	if (y - x) % (a + b) == 0:
		print((y - x) // (a + b))
	else:
		print(-1)


t = int(input())
for x in range(0, t):
	strng1 = input()
	count = 0
	l1 = strng1.split(' ')
	a = int(l1[0])
	b = int(l1[1])
	c = int(l1[2])
	d = int(l1[3])
	n = int((b - a) / (c + d))
	n1 = (b - a) / (c + d)
	if n == n1:
		print(n)
	else:
		print('-1')


lines = int(input())
for line in range(lines):
	l = list(map(int, input().split()))
	(s, e, a, b) = (l[0], l[1], l[2], l[3])
	x = (e - s) / (a + b)
	if x % 2 == 0 or x % 2 == 1:
		print(int(x))
	else:
		print(-1)


import math, 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 list(map(int, input().split()))
for x in range(inp()):
	n = invr()
	v = (n[1] - n[0]) / (n[2] + n[3])
	print(int(v) if v.is_integer() else '-1')


t = int(input())
for i in range(t):
	(x, y, a, b) = map(int, input().split())
	diff = y - x
	coop = a + b
	if diff % coop == 0:
		print(diff // coop)
	else:
		print(-1)


for _ in range(int(input())):
	(x, y, a, b) = [int(j) for j in input().split()]
	(A, d, An) = (x, a + b, y)
	n = An - A
	if n % d == 0:
		print(int(n / d))
	else:
		print(-1)


a = int(input())
for k in range(a):
	b = list(map(int, input().split()))
	if (b[1] - b[0]) % (b[2] + b[3]) == 0:
		print((b[1] - b[0]) // (b[2] + b[3]))
	else:
		print(-1)


for _ in range(int(input())):
	(x, y, a, b) = list(map(int, input().split()))
	(res, t) = divmod(y - x, a + b)
	print(res if t == 0 else -1)


t = int(input())
if 1 <= t <= 1000:
	for i in range(t):
		(x, y, a, b) = input().split()
		a = int(a)
		b = int(b)
		x = int(x)
		y = int(y)
		m = x - y
		n = a + b
		o = m % n
		if o == 0:
			p = m // n
			p = abs(p)
			print(p)
		else:
			print(-1)


t = int(input())
res = []
for i in range(t):
	(x, y, a, b) = [int(x) for x in input().split()]
	curr = (y - x) / (a + b)
	if int(curr) == curr:
		res.append(int(curr))
	else:
		res.append(-1)
for item in res:
	print(item)


t = int(input())
for tt in range(t):
	(x, y, a, b) = map(int, input().split())
	count = 0
	r1 = y - x
	r2 = a + b
	if r1 % r2 == 0:
		print(r1 // r2)
	else:
		print(-1)


def rabbits(x, y, a, b):
	if (y - x) % (a + b) == 0:
		return (y - x) // (a + b)
	return -1
t = int(input())
for i in range(t):
	x = list(map(int, input().rstrip().split()))
	s = x[0]
	y = x[1]
	a = x[2]
	b = x[3]
	print(rabbits(s, y, a, b))


def checker(x, y, a, b):
	return abs(x - y) // (a + b) if abs(x - y) % (a + b) == 0 else -1
for _ in range(int(input())):
	(X, Y, A, B) = [int(i) for i in input().split()]
	print(checker(X, Y, A, B))


def main():
	test = int(input().strip())
	while test > 0:
		(x, y, a, b) = map(int, input().strip().split())
		z = (y - x) / (a + b)
		h = (y - x) % (a + b)
		if h == 0:
			print(int(z))
		else:
			print(-1)
		test -= 1
main()


n = int(input())
for i in range(n):
	(xi, yi, ai, bi) = map(int, input().split())
	if abs(xi - yi) % (ai + bi) == 0:
		print(int(abs(xi - yi) / (ai + bi)))
	else:
		print('-1')


t = int(input())
for i in range(t):
	cats = [int(c) for c in input().split()]
	if (cats[1] - cats[0]) % (cats[2] + cats[3]) == 0:
		print((cats[1] - cats[0]) // (cats[2] + cats[3]))
	else:
		print(-1)


import math
times = int(input())
while times > 0:
	(x, y, a, b) = map(int, input().split())
	t = (y - x) / (a + b)
	if t == math.floor(t):
		print(int(t))
	else:
		print('-1')
	times -= 1


def rabbit():
	(x, y, a, b) = input().split()
	(x, y, a, b) = (int(x), int(y), int(a), int(b))
	d = y - x
	if d % (a + b):
		print(-1)
	else:
		print(d // (a + b))

def main():
	n = int(input())
	for i in range(n):
		rabbit()
main()


test = int(input())
for i in range(test):
	(x_postion, y_postion, x_hop, y_hop) = map(int, input().split(' '))
	if (y_postion - x_postion) % (x_hop + y_hop) == 0:
		print(int((y_postion - x_postion) / (x_hop + y_hop)))
	else:
		print(-1)


tests = int(input())
for test in range(tests):
	(x, y, a, b) = map(int, input().split())
	m = y - x
	c = a + b
	if m % c == 0:
		print(m // c)
	else:
		print(-1)


def meet_at(arr):
	(num, deno) = (arr[1] - arr[0], arr[2] + arr[3])
	if num % deno != 0:
		return -1
	return num // deno
T = int(input().strip())
for t in range(T):
	arr = list(map(int, input().strip().split()))
	print(meet_at(arr))


def calculaTempo(entrada):
	valores = [int(valor) for valor in entrada]
	variacaoPosicao = valores[1] - valores[0]
	velocidadeAproximacao = valores[2] + valores[3]
	if variacaoPosicao % velocidadeAproximacao != 0:
		return -1
	else:
		return variacaoPosicao // velocidadeAproximacao
num = int(input())
for i in range(num):
	entrada = input().split()
	print(calculaTempo(entrada))


ans = []
for t in range(int(input())):
	[s, e, a, b] = [int(i) for i in input().split()]
	if (e - s) % (a + b) != 0:
		ans.append('-1')
		continue
	ans.append(str((e - s) // (a + b)))
print('\n'.join(ans))


t = int(input())
while t > 0:
	(x, y, a, b) = map(int, input().split())
	z = y - x
	r = -1
	if z % abs(b + a) == 0:
		r = z // abs(b + a)
	print(r)
	t -= 1


def will_meet(x, y, dx, dy):
	distance = y - x
	speed = dx + dy
	if distance / speed != distance // speed:
		return -1
	return distance // speed
test_number = int(input())
for _ in range(test_number):
	(x, y, dx, dy) = map(int, input().split())
	result = will_meet(x, y, dx, dy)
	print(result)


import sys
input = lambda : sys.stdin.readline().strip()
for i in range(int(input())):
	(x, y, a, b) = map(int, input().split())
	print((y - x) // (a + b) if (y - x) % (a + b) == 0 else -1)


import sys
INF = 10 ** 18
MOD = 10 ** 9 + 7

def input():
	return sys.stdin.readline().rstrip()

def main():
	t = int(input())
	for _ in range(t):
		(x, y, a, b) = map(int, input().split())
		if (y - x) % (a + b) == 0:
			print((y - x) // (a + b))
		else:
			print(-1)
main()


n = int(input())
for i in range(n):
	(x, y, a, b) = map(int, input().split())
	v = y - x
	c = a + b
	if v / c - v // c < 1 and (v / c).is_integer():
		print(v // c)
	else:
		print(-1)


t = int(input())
a = None
b = None

def F(x):
	return a * x + b * x
for test in range(t):
	(x, y, a, b) = map(int, input().split())
	l = 0
	r = 10 ** 64
	while l != r - 1:
		m = (l + r) // 2
		if F(m) >= y - x:
			r = m
		else:
			l = m
	if r * a + r * b > y - x:
		print(-1)
	else:
		print(r)


t = int(input())
l = list()
for i in range(t):
	l.append(input())
for line in l:
	(x, y, a, b) = [int(s) for s in line.split(' ')]
	d = y - x
	sum = a + b
	if d % sum == 0:
		print(int(round(d / sum)))
	else:
		print('-1')


for _ in range(int(input())):
	(x, y, a, b) = map(int, input().split())
	if x > y:
		print(-1)
		continue
	f = 0
	s = 0
	diff = y - x
	sp = a + b
	if diff % sp == 0:
		print(diff // sp)
	else:
		print(-1)


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, copy, functools
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
mod2 = 998244353
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

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

def LLI():
	return [list(map(int, l.split())) for l in sys.stdin.readlines()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().split()]

def LS():
	return sys.stdin.readline().split()

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def S():
	return input()

def pf(s):
	return print(s, flush=True)

def pe(s):
	return print(str(s), file=sys.stderr)

def JA(a, sep):
	return sep.join(map(str, a))

def JAA(a, s, t):
	return s.join((t.join(map(str, b)) for b in a))

def main():
	t = I()
	rr = []
	for _ in range(t):
		(x, y, a, b) = LI()
		z = y - x
		c = a + b
		if z % c == 0:
			rr.append(z // c)
		else:
			rr.append(-1)
	return JA(rr, '\n')
print(main())


def program():
	(x, y, a, b) = map(int, input().split())
	start = (y - x) // (a + b) - 1
	end = (y - x) // (a + b) + 2
	for t in range(start, end):
		if x + t * a == y - t * b:
			print(t)
			return 0
	print('-1')
t = int(input())
for i in range(t):
	program()


t = int(input())
for _ in range(t):
	(L, H, a, b) = map(int, input().split())
	distance = H - L
	summation = a + b
	if distance // summation == distance / summation:
		print(distance // summation)
	else:
		print('-1')


cases = int(input())
for i in range(cases):
	xyab = input()
	xyab = xyab.split()
	x = int(xyab[0])
	y = int(xyab[1])
	a = int(xyab[2])
	b = int(xyab[3])
	distance = y - x
	hops = a + b
	if distance / hops % 1 != 0:
		print(-1)
	else:
		time = int(distance / hops)
		print(time)


t = int(input())
while t != 0:
	(x, y, a, b) = [int(d) for d in input().split()]
	k = int((y - x) % (a + b))
	l = int((y - x) / (a + b))
	if k == 0:
		print(l)
	else:
		print(-1)
	t -= 1


t = int(input())
while t:
	(x, y, a, b) = (int(i) for i in input().split())
	l = y - x
	if y < x:
		print(-1)
	elif l % (a + b) > 0:
		print(-1)
	else:
		print(l // (a + b))
	t -= 1


t = int(input())
ans = []
for i in range(t):
	(x, y, a, b) = [int(x) for x in input().split()]
	if a + b == 0 or y - x == 0:
		ans.append(-1)
		continue
	time = (y - x) / (a + b)
	if time == (y - x) // (a + b):
		ans.append(int(time))
	else:
		ans.append(int(-1))
for x in ans:
	print(x)


def int_as_array(num):
	return list(map(int, [y for y in str(num)]))

def array_as_int(arr):
	return int(''.join(map(str, arr)))

def read_int():
	return int(input())

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

def int_array_to_string(arr, sep=' '):
	return sep.join(map(str, arr))

def solve(x, y, a, b):
	ans = (y - x) / (a + b)
	if int(ans) == ans:
		return print(int(ans))
	return print(-1)
T = read_int()
for i in range(T):
	(x, y, a, b) = read_int_array()
	solve(x, y, a, b)


I = input
t = int(I())
for tt in range(t):
	t = list(map(int, I().split()))
	a = t[0]
	b = t[1]
	x = t[2]
	y = t[3]
	time = (b - a) / (x + y)
	if int(time) - time == 0:
		print(int(time))
	else:
		print('-1')


def main(trials):
	while trials:
		(x, y, a, b) = map(int, input().strip().split())
		if (y - x) % (a + b):
			print('-1')
		else:
			print((y - x) // (a + b))
		trials -= 1
trials = int(input())
main(trials)


n = int(input())
for x in range(n):
	(startx, starty, diffx, diffy) = map(int, input().split())
	result = (starty - startx) / (diffx + diffy)
	if result == round(result):
		print(round(result))
	else:
		print(-1)


import sys
import math
import itertools
import functools
import collections
import operator

def ii():
	return int(input())

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

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

def lcm(a, b):
	return abs(a * b) // math.gcd(a, b)

def revn(n):
	return str(n)[::-1]

def dd():
	return collections.defaultdict(int)

def ddl():
	return collections.defaultdict(list)

def sieve(n):
	if n < 2:
		return list()
	prime = [True for _ in range(n + 1)]
	p = 3
	while p * p <= n:
		if prime[p]:
			for i in range(p * 2, n + 1, p):
				prime[i] = False
		p += 2
	r = [2]
	for p in range(3, n + 1, 2):
		if prime[p]:
			r.append(p)
	return r

def divs(n, start=2):
	r = []
	for i in range(start, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n / i == i:
				r.append(i)
			else:
				r.extend([i, n // i])
	return r

def divn(n, primes):
	divs_number = 1
	for i in primes:
		if n == 1:
			return divs_number
		t = 1
		while n % i == 0:
			t += 1
			n //= i
		divs_number *= t

def prime(n):
	if n == 2:
		return True
	if n % 2 == 0 or n <= 1:
		return False
	sqr = int(math.sqrt(n)) + 1
	for d in range(3, sqr, 2):
		if n % d == 0:
			return False
	return True

def convn(number, base):
	newnumber = 0
	while number > 0:
		newnumber += number % base
		number //= base
	return newnumber

def cdiv(n, k):
	return n // k + (n % k != 0)
t = ii()
for _ in range(t):
	(x, y, a, b) = mi()
	if (y - x) % (a + b):
		print(-1)
	else:
		print((y - x) // (a + b))


from sys import stdin

def solve(x, y, a, b):
	return -1 if (y - x) % (a + b) != 0 else (y - x) // (a + b)

def main():
	t = int(stdin.readline().strip())
	for _ in range(t):
		(x, y, a, b) = map(int, stdin.readline().strip().split())
		print(solve(x, y, a, b))
main()


from sys import stdin, stdout
fin = stdin.readlines()[1:]
positions = [list(map(int, i.strip().split())) for i in fin]
for i in positions:
	jumps = (i[1] - i[0]) / (i[2] + i[3])
	print(int(jumps) if jumps.is_integer() else -1)


n = int(input())
e = []
for i in range(n):
	(a, b, c, d) = map(int, input().split())
	if (b - a) % (c + d) == 0:
		e.append((b - a) // (c + d))
	else:
		e.append(-1)
for i in e:
	print(i)


n = int(input())
Result = []
for i in range(0, n):
	List = list(map(int, input().strip().split()))[:4]
	x = List[0]
	y = List[1]
	diff = y - x
	a = List[2]
	b = List[3]
	if diff % (a + b) == 0:
		Result.append(int(diff / (a + b)))
	else:
		Result.append(-1)
for i in Result:
	print(i)


n = int(input())
for i in range(n):
	(start, end, a, b) = [int(i) for i in input().split()]
	if (end - start) % (a + b) != 0:
		print(str(-1))
	else:
		print(str((end - start) // (a + b)))


from sys import stdin
from math import ceil, floor
r = stdin.readline

def main():
	cases = int(r())
	for case in range(cases):
		(x, y, a, b) = map(int, r().strip().split())
		ans = (y - x) / (a + b)
		if ceil(ans) != floor(ans):
			print(-1)
		else:
			print(int(ans))
main()


d = int(input())
while d != 0:
	(x, y, a, b) = map(int, input().split(' '))
	s = 0
	if (y - x) % (a + b) == 0:
		s = (y - x) // (a + b)
	else:
		s = -1
	print(s)
	d = d - 1


length = int(input())
(xs, ys, aes, bs) = ([], [], [], [])
for _ in range(length):
	(x, y, a, b) = map(int, input().split())
	xs.append(x)
	ys.append(y)
	aes.append(a)
	bs.append(b)
for (x, y, a, b) in zip(xs, ys, aes, bs):
	distance = y - x
	if distance % (a + b) == 0:
		print(int(distance / (a + b)))
	else:
		print(-1)


number = lambda : int(input())
string = lambda : input()
numbers = lambda : map(int, input().split())
lst = lambda : list(map(int, input().split()))

def main():
	for _ in range(number()):
		(x, y, a, b) = numbers()
		print((y - x) // (a + b) if (y - x) // (a + b) == (y - x) / (a + b) else -1)
main()


case = int(input())
for i in range(case):
	(x, y, a, b) = (int(v) for v in input().split())
	if (y - x) % (a + b) == 0:
		print((y - x) // (a + b))
	else:
		print(-1)


t = int(input())
while t > 0:
	(x, y, a, b) = list(map(int, input().split()))
	k = y - x
	r = a + b
	if k % r == 0:
		print(k // r)
	else:
		print(-1)
	t -= 1


t = int(input())
for i in range(t):
	s = list(map(int, input().split(' ')))
	x = s[0]
	y = s[1]
	a = s[2]
	b = s[3]
	d = y - x
	ds = a + b
	if d % ds == 0:
		print(d // ds)
	else:
		print(-1)


from sys import stdin, stdout
n = int(stdin.readline())
for i in range(n):
	(x, y, a, b) = map(int, stdin.readline().split())
	if (y - x) % (a + b) == 0:
		print(int((y - x) / (a + b)))
	else:
		print(-1)


import sys, math
input = sys.stdin.readline

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

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

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

def invr():
	return map(int, input().split())
t = 1
t = inp()
for tt in range(t):
	(x, y, a, b) = invr()
	if (y - x) // (a + b) == (y - x) / (a + b):
		print((y - x) // (a + b))
	else:
		print(-1)


def problemA():
	t = int(input())
	for _ in range(t):
		(x, y, a, b) = map(int, input().split())
		if (y - x) % (a + b) == 0:
			print((y - x) // (a + b))
		else:
			print(-1)

def problemG():
	t = int(input())
	for _ in range(t):
		n = int(input())
		a = map(int, input().split())
		res = 0
		print(a)
problemA()


t = int(input())
for _ in range(t):
	(x, y, a, b) = map(int, input().split())
	ans = (y - x) // (a + b)
	ans = ans + 1
	s1 = x + a * (ans - 1)
	s2 = y - b * (ans - 1)
	if s1 == s2:
		print(ans - 1)
	else:
		print(-1)


a = int(input())
for i in range(a):
	mas = [int(i) for i in input().split()]
	m = (mas[1] - mas[0]) / (mas[2] + mas[3])
	if m % 1 == 0:
		print(int(m))
	else:
		print(-1)


for _ in range(int(input())):
	n = [int(h) for h in input().strip().split(' ')]
	dist = n[1] - n[0]
	if dist % (n[2] + n[3]) == 0:
		print(dist // (n[2] + n[3]))
	else:
		print(-1)


t = int(input())
while t > 0:
	t -= 1
	xt = input().split()
	x = int(xt[0])
	y = int(xt[1])
	a = int(xt[2])
	b = int(xt[3])
	time = (y - x) / (a + b)
	tp = (y - x) % (a + b)
	if time > 0 and tp == 0:
		print(int(time))
	else:
		print(-1)


def calc(arr: list):
	(x, y, a, b) = (arr[0], arr[1], arr[2], arr[3])
	temp1 = abs(x - y) / (a + b)
	temp2 = int(temp1)
	if temp1 - temp2 == 0:
		return temp2
	else:
		return -1

def main():
	for _ in range(int(input())):
		print(calc(list(map(int, input().split()))))
main()


from sys import stdin, stdout
rl = lambda : stdin.readline()
rll = lambda : stdin.readline().split()

def main():
	T = int(rl())
	for _ in range(T):
		(x, y, a, b) = [int(x) for x in rll()]
		(c1, c2) = (y - x, a + b)
		if c1 % c2 == 0:
			stdout.write(str(c1 // c2))
			stdout.write('\n')
		else:
			stdout.write(str(-1))
			stdout.write('\n')
	stdout.close()
main()


import sys
import math
import bisect

def main():
	for _ in range(int(input())):
		(x, y, a, b) = map(int, input().split())
		if (y - x) % (a + b) == 0:
			print((y - x) // (a + b))
		else:
			print(-1)
main()


import sys
pin = sys.stdin.readline
pout = sys.stdout.write
ran = range
m = int(pin())
mape = map
for i in ran(m):
	(x, y, a, b) = mape(int, pin().split())
	xy = abs(x - y)
	ab = a + b
	if xy % ab == 0:
		print(int(xy / ab))
	else:
		print(-1)


a = int(input())
for f in range(a):
	h = [int(j) for j in input().split()]
	if (h[1] - h[0]) % (h[2] + h[3]) > 0:
		print(-1)
	else:
		print((h[1] - h[0]) // (h[2] + h[3]))


t = int(input())
res = []
for i in range(t):
	(x, y, a, b) = map(int, input().split())
	t = (y - x) // (a + b)
	if t == (y - x) / (a + b):
		res.append(t)
	else:
		res.append(-1)
for output in res:
	print(output)


T = int(input())
for i in range(T):
	(x, y, a, b) = map(int, input().split())
	d = y - x
	e = a + b
	if d % e != 0:
		print(-1)
	else:
		print(int(d / e))


for _ in range(int(input())):
	a = list(map(int, input().split()))
	t = 0
	s = (a[1] - a[0]) % (a[2] + a[3])
	if s == 0:
		t = (a[1] - a[0]) // (a[2] + a[3])
	else:
		t = -1
	print(t)


T = int(input())
while T > 0:
	(x, y, a, b) = map(int, input().split())
	if (y - x) % (a + b) == 0:
		print((y - x) // (a + b))
	else:
		print(-1)
	T -= 1


n = int(input())
l = []
for i in range(0, n):
	ar = list(map(int, input().rstrip().split()))
	l.append(ar)
for i in l:
	rabbit1_pos = i[0]
	rabbit2_pos = i[1]
	rabbit1_speed = i[2]
	rabbit2_speed = i[3]
	time = (rabbit2_pos - rabbit1_pos) / (rabbit1_speed + rabbit2_speed)
	if time < 0 or time % 1 != 0:
		time = -1
	print(int(time))


tc = int(input())
for i in range(tc):
	(x, y, a, b) = map(int, input().strip().split())
	if (y - x) % (a + b):
		print(-1)
	else:
		print((y - x) // (a + b))


import sys
T = int(sys.stdin.readline())
for i in range(T):
	(a, b, c, d) = map(int, sys.stdin.readline().split())
	if int((b - a) / (c + d)) == (b - a) / (c + d):
		print(int((b - a) / (c + d)))
	else:
		print(-1)


def function(list_input):
	(x, y, a, b) = (list_input[0], list_input[1], list_input[2], list_input[3])
	r_time = (y - x) / (a + b)
	if r_time.is_integer():
		print(int(r_time))
	else:
		print(-1)
T = int(input())
for i in range(T):
	input_list = list(map(int, input().split()))
	function(input_list)


t = int(input())
for i in range(t):
	(a, b, c, d) = map(int, input().split())
	k = b - a
	p = c + d
	l = k / p
	if int(l) == l:
		print(int(l))
	else:
		print(-1)


t = int(input())
result = [0] * t
for i in range(t):
	(x, y, a, b) = map(int, input().split())
	min_time = 0
	max_time = 10 ** 9
	while min_time < max_time - 1:
		mid_time = (max_time + min_time) // 2
		if x + a * mid_time >= y - b * mid_time:
			max_time = mid_time
		else:
			min_time = mid_time
	if x + a * max_time == y - b * max_time:
		result[i] = max_time
	else:
		result[i] = -1
for i in range(t):
	print(result[i])


import math
for _ in range(int(input())):
	A = list(map(int, input().split(' ')))
	ans = (A[1] - A[0]) / (A[2] + A[3])
	if abs(ans - math.floor(ans)) == 0:
		print(int(ans))
	else:
		print('-1')


tc = int(input())

def solve(x, y, a, b):
	if (y - x) % (a + b) == 0:
		return (y - x) // (a + b)
	else:
		return -1
for _ in range(tc):
	(x, y, a, b) = map(int, input().split())
	print(solve(x, y, a, b))


import math
t = int(input())
for _ in range(t):
	(x, y, a, b, *algo) = input().split()
	x = int(x)
	y = int(y)
	a = int(a)
	b = int(b)
	tseg = (y - x) / (a + b)
	(decimal, entero) = math.modf(tseg)
	if decimal == 0:
		print(int(tseg))
	else:
		print(-1)


t = int(input())
for i in range(t):
	line = input().split()
	x = line[0]
	y = line[1]
	a = line[2]
	b = line[3]
	dist = int(y) - int(x)
	combined = int(a) + int(b)
	if dist % combined == 0:
		print(int(dist / combined))
	else:
		print('-1')


col = int(input())
for _ in range(col):
	L = list(map(int, input().split()))
	if (L[1] - L[0]) % (L[2] + L[3]) == 0:
		print((L[1] - L[0]) // (L[2] + L[3]))
	else:
		print('-1')


import fractions
for _ in range(int(input())):
	(x, y, a, b) = map(int, input().split())
	t = fractions.Fraction(y - x) / (a + b)
	if t.denominator == 1:
		print(t)
	else:
		print(-1)


for A in range(int(input())):
	(x, y, a, b) = list(map(int, input().split(' ')))
	d = y - x
	d2 = a + b
	if d % d2 != 0:
		print(-1)
		continue
	print(d // d2)


def two_rabbits(x, y, a, b):
	distance = y - x
	return -1 if distance % (a + b) != 0 else distance // (a + b)
for _ in range(int(input())):
	(x, y, a, b) = map(int, input().split())
	print(two_rabbits(x, y, a, b))


def rabbit(x, y, a, b):
	r = (y - x) / (a + b)
	if int(r) != r:
		print(-1)
		return
	print(int(r))
n = int(input())
for i in range(n):
	l = list(map(int, input().split()))
	rabbit(l[0], l[1], l[2], l[3])


from math import *

def binarySearch(arr, x):
	l = 0
	r = len(arr) - 1
	while l <= r:
		mid = (l + r) // 2
		if arr[mid] == x:
			return mid
		elif arr[mid] < x:
			l = mid + 1
		else:
			r = mid - 1
	return -1

def js(arr, x):
	l = 0
	r = len(arr) - 1
	ans = -1
	while l <= r:
		m = (l + r) // 2
		if arr[m] <= x:
			ans = m
			l = m + 1
		else:
			r = m - 1
	return ans

def jg(arr, x):
	l = 0
	r = len(arr) - 1
	ans = -1
	while l <= r:
		m = (l + r) // 2
		if arr[m] >= x:
			ans = m
			r = m - 1
		else:
			l = m + 1
	return ans

def ceil(a, b):
	if a % b == 0:
		return int(a / b)
	else:
		return a // b + 1
for i in range(int(input())):
	(x, y, a, b) = map(int, input().split())
	if (y - x) % (a + b) == 0:
		print((y - x) // (a + b))
	else:
		print(-1)


from sys import stdin, stdout
take = lambda : list(map(int, stdin.readline().split()))
for _ in range(int(input())):
	(x, y, a, b) = take()
	if (y - x) % (a + b) == 0:
		print((y - x) // (a + b))
	else:
		print('-1')


t = int(input())

def judge(x, y, a, b):
	d_init = y - x
	d_step = a + b
	if d_init % d_step == 0:
		return int(d_init / d_step)
	return -1
for i in range(t):
	(x, y, a, b) = list(map(int, input().split(' ')))
	print(judge(x, y, a, b))


n = int(input())
out = []
for i in range(n):
	(x, y, a, b) = input().split(' ')
	(x, y, a, b) = (int(x), int(y), int(a), int(b))
	x += a
	y -= b
	b = -b
	n = (x + b - a - y) / (b - a)
	n1 = int(n)
	if n == n1:
		out.append(n1)
	else:
		out.append(-1)
for i in out:
	print(i)


t = int(input())
for test in range(t):
	(x, y, a, b) = map(int, input().split())
	t = (y - x) // (a + b)
	if x + t * a == y - t * b:
		print(t)
	else:
		print(-1)


import math
import sys
Input = sys.stdin.readline
for _ in range(int(input())):
	(x, y, a, b) = map(int, input().split())
	c = x - y
	print(-1) if c % (a + b) != 0 else print(math.ceil(abs(c / (a + b))))


n = int(input())
ans = []
for i in range(n):
	tmp = list(map(int, input().split(' ')))
	if (tmp[0] - tmp[1]) % (tmp[2] + tmp[3]) == 0:
		ans.append(-int((tmp[0] - tmp[1]) / (tmp[2] + tmp[3])))
		continue
	ans.append(-1)
for i in ans:
	print(i)


def main():
	temp = input()
	temp = temp.split(' ')
	temp = [int(x) for x in temp]
	if (temp[1] - temp[0]) % (temp[2] + temp[3]) == 0:
		return (temp[1] - temp[0]) // (temp[2] + temp[3])
	return -1
n = int(input())
for i in range(n):
	print(main())


import sys
input = lambda : sys.stdin.readline().rstrip()
for _ in range(int(input())):
	(x, y, a, b) = map(int, input().split())
	ans = (y - x) / (a + b)
	ans1 = (y - x) // (a + b)
	if ans < 0:
		print(-1)
		continue
	if ans.is_integer():
		print(ans1)
	else:
		print(-1)


import sys
for _ in range(int(sys.stdin.readline().rstrip())):
	(x, y, a, b) = list(map(int, sys.stdin.readline().rstrip().split()))
	i = 0
	j = 1000000000
	re = 0
	while True:
		mid = int((i + j) / 2)
		if x + mid * a == y - mid * b:
			print(mid)
			break
		if x + mid * a > y - mid * b:
			j = mid - 1
		elif x + mid * a < y - mid * b:
			i = mid + 1
		if i > j:
			print(-1)
			break


t = int(input())
while t != 0:
	t -= 1
	k = 0
	c = 0
	(x, y, a, b) = tuple(map(int, input().split()))
	if (y - x) % (a + b) == 0:
		print(int((y - x) / (a + b)))
	else:
		print(-1)


def solve():
	(A, B, C, D) = map(int, input().split())
	if (B - A) % (C + D) == 0:
		print((B - A) // (C + D))
	else:
		print(-1)
T = int(input())
for _ in range(T):
	solve()


import sys
from math import *
n = int(sys.stdin.readline())
for i in range(n):
	(x, y, a, b) = map(int, sys.stdin.readline().split())
	t = (y - x) / (b + a)
	if int(t) == t:
		print(int(t))
	else:
		print(-1)


x = int(input())
lst = []
for i in range(x):
	lst.append(input())
for i in lst:
	a = list(map(int, i.split()))
	distance = a[1] - a[0]
	foot = a[2] + a[3]
	if distance % foot != 0:
		print(-1)
	else:
		print(distance // foot)