#include <iostream>
#include <vector>
#include <cmath>

using namespace std;


int main()
{
	int t;
	cin >> t;

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

		int n; cin >> n;

		vector <int> a(n);
		vector<int> b(n);
		vector<int> add (n);
		vector <int> subtract (n);
		vector<int> addindex;
		vector <int> subtractindex;
		int count = 0;

		int asum = 0;
		int bsum = 0;

		for (int j = 0; j < n; j++) {
			cin >> a[j];
			asum += a[j];
		}

		for (int j = 0; j < n; j++) {
			cin >> b[j];
			bsum += b[j];
		}

		if (asum != bsum) {
			cout << -1 << endl;
			continue;
		}

		for (int j = 0; j < n; j++) {

			if (b[j] - a[j] > 0) {
				add[j] = b[j] - a[j];
				addindex.push_back(j+1);
			}
			else if (b[j] - a[j] < 0) {
				subtract[j] = b[j] - a[j];
				subtractindex.push_back(j + 1);
			}
		}

		for (int j = 0; j < n; j++) {
			count += add[j];
		}




		cout << count << endl;

		if (count == 0) {
			continue;
		}


		for (int j = 0; j < count; j++) {

			cout << subtractindex[0] << " " << addindex[0] << endl;

			subtract[subtractindex[0] - 1]++;
			add[addindex[0] - 1]--;

			if (add[addindex[0] - 1] == 0) {
				addindex.erase(addindex.begin());
			}

			if (subtract[subtractindex[0] - 1] == 0) {
				subtractindex.erase(subtractindex.begin());
			}
		}
		

		
	}

}

