/******************************    *                            *    *    author :  rion_cse      *    *    created:  11.07.2021    *    *                            *    ******************************/       /*******************************************************    *                                                     *    *  ***-->    BISMILLAHIR RAHMANIR RAHIM    <--***     *    *  ***--> ISLAMIC UNIVERSITY OF BANGLADESH <--***     *    *  ***--> COMPUTER SCIENCE AND ENGINEERING <--***     *    *                                                     *    *******************************************************/       #include<bits/stdc++.h>   const int MOD=1e9+7;       #define  pf                 printf   #define  sc                 scanf       #define  s1(n)              scanf( %d ,&n)   #define  s2(n1,n2)          scanf( %d %d ,&n1,&n2)   #define  s3(n1,n2,n3)       scanf( %d %d %d ,&n1,&n2,&n3)   #define  s4(n1,n2,n3,n4)    scanf( %d %d %d %d ,&n1,&n2,&n3,&n4)       #define  ss1(n)             scanf( %lld ,&n)   #define  ss2(n1,n2)         scanf( %lld %lld ,&n1,&n2)   #define  ss3(n1,n2,n3)      scanf( %lld %lld %lld ,&n1,&n2,&n3)   #define  ss4(n1,n2,n3,n4)   scanf( %lld %lld %lld %lld ,&n1,&n2,&n3,&n4)       #define  p1(x)              printf( %I64d ,x)   #define  p2(x,y)            printf( %I64d %I64d ,x,y)   #define  p3(x,y,z)          printf( %I64d %I64d %I64d ,x,y,z)       #define  fi(i,a,b)          for(long long i=a;i<=b;i++)   #define  fm(i , a)          for(long long i=1;i<=a;i++)   #define  fd(i,a,b)          for(long long i=b;i>=a;i--)       #define  clr(x)             memset(x,0,sizeof(x))   #define  cln(x)             memset(x,-1,sizeof(x))       #define  fw                 freopen( output.txt , w ,stdout);       typedef long long int ll;   ///ll ar[1009],arr[1009];   using namespace std;       /*ll LCM(ll a,ll b)   {       return (a/(__gcd(a,b)))*b;   }*/       int main()   {        ll t;        cin>>t;        while(t--)        {         ll n,i,j;         cin>>n;         ll ar[n+5],br[n+5],s=0,s1=0;         vector< ll > v,vc;         for(i=1;i<=n;i++)         {          cin>>ar[i];          s+=ar[i];         }            for(i=1;i<=n;i++)         {           cin>>br[i];            s1+=br[i];         }                  if(s!=s1) cout<< -1 <<endl;         else {                for(i=1;i<=n;i++)                {                 if(ar[i]>br[i]){                   for(j=1;j<=(ar[i]-br[i]);j++)                   v.push_back(i);                 }                    else if(ar[i]<br[i]){                    for(j=1;j<=(br[i]-ar[i]);j++)                   vc.push_back(i);                 }                }                cout<<v.size()<<endl;                for(i=0;i<v.size();i++)                 cout<<v[i]<<   <<vc[i]<<endl;              }      }       return 0;   }   