
#include<bits/stdc++.h>
using namespace std;
#define ff first
#define ss second
#define PI acos(-1)
#define pb push_back
#define int long long
#define ld long double
#define sp fixed<<setprecision
#define bp __builtin_popcountll
#define all(x) x.begin(),x.end()
#define pii pair<long long,long long>
#define FAST ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
const int M = (1e9) + 7;
const int N = 200005;
const int INF = 1e12;

bool sec(const pair<int, int>a, const pair<int, int>b) {
	return a.ss < b.ss;
}

void solve(){
	int n;
	cin>>n;
	int ar1[n+1],ar2[n+1];
	ar1[0]=ar2[0]=0;
	int sum1=0,sum2=0;
	for(int i=1;i<n+1;i++){
		cin>>ar1[i];
		sum1+=ar1[i];
	}
	for(int i=1;i<n+1;i++){
		cin>>ar2[i];
		sum2+=ar2[i];
	}
	if(sum1!=sum2){
		cout<<"-1\n";
	}else{
		int i=1,j=1;
		vector<pair<int,int> >ans;
		for( i=i;i<n+1;i++){
			if(ar1[i]>ar2[i]){
				for(j=j;j<n+1;j++){
					if(ar1[j]<ar2[j]){
						while((ar1[i]!=ar2[i])&&(ar1[j]!=ar2[j])){
							ar1[i]--;
							ar1[j]++;
							ans.pb(make_pair(i,j));
						}
						i--;
						j--;
						break;
					}
				}
			}
		}
		cout<<ans.size()<<"\n";
		for(int k=0;k<ans.size();k++){
			cout<<ans[k].ff<<" "<<ans[k].ss<<"\n";
		}
	}

}


signed main()
{
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
	freopen("error.txt", "w", stderr);
#endif
	FAST
	int tc = 1;
	cin>>tc;
	for (int t = 1; t <= tc; t++)
	{
		solve();
	}
	cerr << "Time : " << 1000 * ((double)clock()) / (double)CLOCKS_PER_SEC << "ms\n";
	return 0;
}


