#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double ld;
#define IOS ios_base::sync_with_stdio(0); cin.tie(NULL); cout.tie(NULL);
#define rep(i,a,b)  for(ll i=a;i<b;i++)
#define repr(i,a,b)  for(ll i=a;i>=b;i--)
#define nl cout<<"\n";
#define MS(x, y) memset(x, y, sizeof(x))
 
#define pii pair<ll,ll>
#define vi  vector<ll>
#define vii vector<pii>
#define mi  map<ll,ll>
#define all(a)  a.begin(),a.end()
 
#define pb push_back
#define ff first
#define ss second
#define MOD 1000000007
 
#define test4(x,y,z,a) cout<<"x is "<<x<<"		y is "<<y<<"		z is "<<z<<"		a is "<<a<<endl;
#define test3(x,y,z) cout<<"x is "<<x<<"		y is "<<y<<"		z is "<<z<<endl;
#define test2(x,y) cout<<"x is "<<x<<"		y is "<<y<<endl;
#define test1(x) cout<<"x is "<<x<<endl;
#define N 300009


 
ll powermodm(ll x,ll n,ll M){ll result=1;while(n>0){if(n % 2 ==1)result=(result * x)%M;x=(x*x)%M;n=n/2;}return result;}
ll power(ll _a,ll _b){ll _r=1;while(_b){if(_b%2==1)_r=(_r*_a);_b/=2;_a=(_a*_a);}return _r;}
ll gcd(ll a,ll b){if(a==0)return b;return gcd(b%a,a);}
ll lcm(ll a,ll b){return (max(a,b)/gcd(a,b))*min(a,b);}
void write(ll a[],ll n){
    rep(i,0,n)cout<<a[i]<<" ";
    nl
}

void fun()
{
   ll n;
   cin>>n;
   vector<ll> a(n),b(n);
   ll sum=0;
   for(auto &x:a){
      cin>>x;
      sum+=x;
   }
   for(auto &x:b){
      cin>>x;
      sum-=x;
   }
   if(sum!=0){
      cout<<"-1\n";
      return;
   }
   vector<pair<ll,ll>> jj,ii;

   rep(i,0,n){
      if(a[i]-b[i]>0){
         ii.pb({i,a[i]-b[i]});
      }
      else if(a[i]-b[i]<0)
         jj.pb({i,-a[i]+b[i]});
   }
   ll k=0;
   vector<pair<ll,ll>> ans;
   for(auto &x:ii){
      while(x.ss>0){
         if(jj[k].ss<=0)
            k++;
         ans.pb({x.ff,jj[k].ff});
         jj[k]={jj[k].ff,jj[k].ss-1};
         x.ss-=1;
      }

   }
   cout<<ans.size()<<"\n";
   for(auto x:ans)
      cout<<x.ff+1<<" "<<x.ss+1<<"\n";
   return;
      
}
int main()
{
	IOS
	ll t=1;
	#ifndef ONLINE_JUDGE
        if (fopen("input.txt", "r"))
        {
           freopen("input.txt", "r", stdin);
           freopen("output.txt", "w", stdout);
        }
    #endif
	cin>>t;
	while(t--)
		fun();
	return 0;
}