﻿#include<bits/stdc++.h>
#define int long long
using namespace std;

const int N = 2e5+7;
const double eps = 1e-8;
const int inf = 0x7f7f7f7f;
int T;
int n,m,k;
int a[N],b[N],c[N];
int ans,suma,sumb;
vector<int> p,q;

signed main(){
	cin>>T;
	while(T--){
		cin>>n;
		suma=sumb=0;
		p.clear();
		q.clear();
		for(int i=1;i<=n;i++){
			cin>>a[i];
			suma+=a[i];
		}
		for(int i=1;i<=n;i++){
			cin>>b[i];
			sumb+=b[i];
		}
		if(suma!=sumb){
			cout<<"-1\n";
			continue;
		}
		for(int i=1;i<=n;i++){
			c[i]=a[i]-b[i];
			if(c[i]>0){
				for(int j=1;j<=c[i];j++){
					p.push_back(i);
				}
			}
			if(c[i]<0){
				for(int j=1;j<=-c[i];j++){
					q.push_back(i);
				}
			}
		}
		cout<<p.size()<<"\n";
		while(!p.empty()){
			cout<<p.back()<<" "<<q.back()<<"\n";
			p.pop_back();
			q.pop_back();
		}
		
	}
	return 0;
}