#include<bits/stdc++.h>
using namespace std;
#define lc cout<<"\n"
#define f1(a) for(int i=0;i<a;++i)
int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	int t;cin>>t;
	while(t--){
		int n;cin>>n;
		int a[n],b[n];
		std::vector<int> pos_index,pos_dif;
		std::vector<int> neg_index,neg_dif;
		f1(n){cin>>a[i];}
		f1(n){cin>>b[i];}
		int test=0;
		f1(n){test+=a[i]-b[i];
			if(a[i]-b[i]>0){pos_index.emplace_back(i);pos_dif.emplace_back(a[i]-b[i]);}
			else{
				if(a[i]-b[i]<0){
				neg_index.emplace_back(i);neg_dif.emplace_back(b[i]-a[i]);
				}
			}}
		if(test!=0){cout<<-1;lc;}
		else{
			f1(n){test+=abs(a[i]-b[i]);}
			int res=test/2;
			cout<<res;lc;
			vector<int>fr,se;
			f1(pos_dif.size()){while(pos_dif[i]--){fr.emplace_back(pos_index[i]);}}
			f1(neg_dif.size()){while(neg_dif[i]--){se.emplace_back(neg_index[i]);}}
			f1(fr.size()){cout<<fr[i]+1<<" "<<se[i]+1;lc;}

			
			
		}
		

	}
	return 0;
}