#include<bits/stdc++.h>
#define ll long long
#define x first
#define y second
#define pi pair
#define K 1000000007;
#define eps 1e-9
#define endl "\n";cout.flush()
using namespace std;
ll a[2000000];
ll b[200000];
int main() {
	/*
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
	*/
    //freopen("Desktop/SubmissionFile/input.txt","r",stdin);
	ll test_case=1,tc=0;cin>>test_case;

	while(test_case--&&++tc){
		ll n;cin>>n;
		vector<ll> ans(n,0);
		for(ll i=0;i<n;i++)cin>>a[i];
		ll sum=0;
		for(ll i=0;i<n;i++){
			cin>>b[i],ans[i]=b[i]-a[i];
			sum+=ans[i];
		}
		if(sum==0){
			vector<ll> pos,neg;
			ll m=0;
			for(ll i=0;i<n;i++){
				if(ans[i]>0){pos.push_back(i),m+=ans[i];}
				else if(ans[i]<0)neg.push_back(i);
			}
			cout<<m<<endl;
			ll i=0,j=0;
			while(m--){
				cout<<neg[j]+1<<" " <<pos[i]+1<<endl;
				ans[pos[i]]--;
				ans[neg[j]]++;
				if(ans[pos[i]]==0)i++;
				if(ans[neg[j]]==0)j++;
			}	

		}
		else cout<<"-1" <<endl;
			
	}
	return 0;
}
