
#include<bits/stdc++.h>
using namespace std;


// problem A
/*int main()
{
	int t; scanf("%d", &t);

	for (int j = 0; j < t; j++) {
		int n; scanf("%d", &n);
		int a; scanf("%d", &a);
		int b; scanf("%d", &b);

		char cc[1001];  scanf("%s", &cc);
		string s = cc;

		if ((a >= 0 && b >= 0)||((a<0)||b>=0)) {
			printf("%d\n", s.size() * (a + b));
		}
		else if (a<0&&b<0) { // 
			int maxx = max(s.size() * (a + b), a * s.size() + b);
		}
		else {
			int one = 0, zero = 0;

			for (int i = 0; i < s.size(); i++)
			{
				if (s[i] == '1') one++;
				else zero++;

			}
			int count = 0, cc = 0;
			char  small;
			int remain = max(one, zero);
			if (one < zero) {
				small = '1';

			}

			else { small = '0'; }
			for (int i = 0; i < s.size() - 1; i++) {
				if (s[i] == s[i + 1] &&s[i]==small) cc++;

				else {
					if (cc <= 0) continue;
					++cc;
					count += (cc * a) + b;

					cc = 0;
				}
			}

			count += remain * a + b;

			printf("%d\n", count);
		}
		
	}
}*/




/*int main() {

	int t; scanf("%d",&t);
	
	for (int i = 0; i < t; i++) {

		int n; scanf("%d", &n);
		int a; scanf("%d", &a);
		int b; scanf("%d", &b);

		char ss[101]; 
		scanf("%s", &ss);
		string s = ss;

		int ans = a * n;
		if (b >= 0) {
			printf("%d\n", (a+b)*s.size());
		}
		else {
			int cc = 1;
			for (int i=0;i<s.size()-1; i++) {

				if (s[i] != s[i + 1]) cc++;


			}
			int bb = b*(cc / 2 + 1);
			ans += bb;
			printf("%d\n", ans);

		}


	}
	return 0;
}*/



// problem a


int main() {

	int t; scanf("%d",&t);

	
	for (int i = 0; i < t; i
		++) {

		int n; scanf("%d", &n);
		vector <int > a(n), b(n);
		vector <pair<int, int>> ans;
		int suma = 0, sumb = 0;
		for (int j = 0; j < n; j++) {
			scanf("%d", &a[j]);
		

			suma += a[j];
	
		}	
		for (int j = 0; j < n; j++) {
			scanf("%d", &b[j]);
		

			sumb+=b[j];
	
		}
		



		int count = 0;
		if (suma != sumb) {
			printf("%d\n", -1);
			continue;
		}

		for (int j = 0; j < n; ) { // j++
			int ii, jj;
			if (a[j] == b[j]) { j++; continue; }
			
			else if (a[j] > b[j]) {
				 ii = j;
				
				count++;
				a[j] -= 1;
				for (int k = j + 1; k < n; k++) {
					if (a[k] < b[k]) {
						jj = k; a[k] += 1;
						break;
					}
				}
			}
			else if (a[j] < b[j]) {
				count++;
				jj = j;
				a[j] =a[j]+ 1;
				for (int k = j + 1; k < n; k++) {
					if (a[k] > b[k]) {
						ii = k;  a[k] =a[k]-1 ;
						break;
					}
				}
			}

			ans.push_back(make_pair(ii, jj));
			if (a[j] == b[j]) j++;
		}
		printf("%d\n", count);
		for (int u = 0; u < ans.size(); u++) printf("%d  %d\n", 1+ans[u].first, 1+ans[u].second );
		printf("\n");
		
	}


}