/******************************************************************************

                              Online C++ Compiler.
               Code, Compile, Run and Debug C++ program online.
Write your code in this editor and press "Run" button to compile and execute it.

*******************************************************************************/

#include <iostream>
#include<bits/stdc++.h>

using namespace std;

int main()
{
   int t;
   cin>>t;
   while(t--){
       int n;
       cin>>n;
       vector<int> a(n),b(n);
       long long int x=0,y=0;
       for(int i=0;i<n;i++)
      { cin>>a[i];
      x+=a[i];
      }
       for(int i=0;i<n;i++)
      { cin>>b[i];
      y+=b[i];
      }
       if(x!=y){
           cout<<-1<<endl;
       }
       else{
           
           vector<int> x,y;
           for(int i=0;i<n;i++){
               int z=abs(a[i]-b[i]);
               if(a[i]>b[i]){
               while(z--)
               x.push_back(i+1);
               }
               else{
                   while(z--){
                       y.push_back(i+1);
                   }
               }
           }
           cout<<x.size()<<endl;
           for(int i=0;i<x.size();i++){
               cout<<x[i]<<" "<<y[i]<<endl;
           }
       }
   }
}
