#include<bits/stdc++.h>
using namespace std;
int main()
{
   signed long long t,n,i,l,y,z,sum1,sum2,x,f,m,j,r,sum,k,d,num,q,h,u,v,np,nl,p,c;
   cin>>t;
   while(t>0)
   {
       cin>>n;
       long long int a[n],b[n];
       vector<pair<int,int>>v1,v2,v3;
       sum1=0;
       sum2=0;
       for(i=0;i<n;i++)
       {
           cin>>a[i];
       }
       for(i=0;i<n;i++)
       {
           cin>>b[i];
       }
       for(i=0;i<n;i++)
       {
           if(a[i]>b[i])
           {
               sum1=sum1+a[i]-b[i];
               v1.push_back({a[i]-b[i],i+1});
           }
           if(a[i]<b[i])
           {
               sum2=sum2+b[i]-a[i];
               v2.push_back({b[i]-a[i],i+1});
           }
       }
       if(sum1!=sum2)
       {
           cout<<"-1\n";
       }
       else if(sum1==0)
       {
           cout<<"0\n";
       }
       else
       {
           i=0;
           j=0;
           while(i<v1.size()&&j<v2.size())
           {
               if(v1[i].first==0)
               {
                   i++;
               }
               else if(v2[j].first==0)
               {
                   j++;
               }
               else
               {
                   v3.push_back({v1[i].second,v2[j].second});
                   v1[i].first--;
                   v2[j].first--;
               }
           }
           cout<<v3.size()<<endl;
           for(i=0;i<v3.size();i++)
           {
               cout<<v3[i].first<<" "<<v3[i].second<<endl;
           }
       }
       t--;
   }
       return 0;
}
