Problem Statement
Little Elephant from Zoo of Lviv likes bamboo very much. He currently has n stems of bamboo, Hi - height of i-th stem of bamboo (0-based numeration). 

Today inspector Andrii from World Bamboo Association is visiting the plantation. He doesn't like current situation. He wants the height of i-th stem to be Di, for each i from 0 to n-1, inclusive.

Little Elephant is going to buy some special substance. One bottle of such substance he can use to single stem of bamboo. After using substance for stem i, the height of i-th stem is decrased by 1 and the height of j-th stem is increased by 1 for each j not equal to i. Note that it is possible for some of the stems to have negative height, but after all transformations all stems should have positive height.

Substance is very expensive. Help Little Elephant and find the minimal number of bottles of substance required for changing current plantation to one that inspector wants. If it's impossible, print -1.


Input
First line contain single integer T - the number of test cases. T test cases follow. First line of each test case contains single integer n - the number of stems in the plantation. Second line contains n integers separated by single space - starting plantation. Next line of each test case contains n integers - plantation that inspector Andrii requires.


Output
In T lines print T integers - the answers for the corresponding test cases.


Constraints

1 <= T <= 50

1 <= n <= 50

1 <= Hi, Di <= 50


Example

Input:
3
1
1
2
2
1 2
2 1
3
3 2 2
4 5 3


Output:
-1
1
5
for _ in xrange(int(raw_input())):
	n = int(raw_input())
	l1 = map(int, raw_input().split())
	l2 = map(int, raw_input().split())
	s1 = sum(l1)
	s2 = sum(l2)
	if n == 1:
		if s2 > s1:
			print -1
		if s2 == s1:
			print 0
		if s1 > s2:
			print s1 - s2
	elif n == 2:
		if s1 != s2:
			print -1
		else:
			print abs(l1[0] - l2[0])
	else:
		if (s1 - s2 > 0):
			print -1
		elif (((s2 - s1) % (n-2)) != 0):
			print -1
		else:
			t = (s2 - s1)/(n-2)
			pos = True
			for i in xrange(len(l1)):
				if ((t -l2[i] + l1[i]) < 0):
					pos = False
				elif ((t -l2[i] + l1[i]) % 2) != 0:
					pos = False
			if pos:
				print t
			else: 
				print -1