

#pragma region TEMPLATE

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <queue>
#include <map>
#include <cstdio>
#include <cmath>
#include <stack>
#include <limits.h>
#include <bitset>
#include <ctime>

#include <unordered_map>
#include <unordered_set>
#include <set>

using namespace std;

typedef unsigned long long int ulli;
typedef long long int lli;
typedef long int li;

typedef pair<int, int> pii;

typedef map<string, int> msi;
typedef map<string, string> mss;

typedef vector<int> vi;
typedef vector<lli> vlli;
typedef vector<bool> vb;
typedef vector<string> vs;

#define pb push_back



#define MOD1 1000000007

#define MOD2 1000000009

#define FOR1(i,n) for(int i=0; i<n; i++)
#define RFOR1(i,n) for(int i=n-1; i>=0; i--)

#define OUT0(x) cout<<(x)<<" " 
#define OUT1(x) cout<<(x)<<endl 
#define OUT2(x,y) cout<<(x)<<" "<<(y)<<endl 
#define TRACE1(x) cout<<(#x)<<" "<<(x)<<endl
#define TRACE2(x,y) cout<<(#x)<<" "<<(x)<<", "<<(#y)<<" "<<(y)<<endl
#define TRACE3(x,y,z) cout<<(#x)<<" "<<(x)<<", "<<(#y)<<" "<<(y)<<", "<<(#z)<<" "<<(z)<<endl

#define MIN3(x,y,z) min(x,min(y,z))
#define MAX3(x,y,z) max(x,max(y,z))

#define IN1(x) cin>>(x)
#define IN2(x,y) cin>>(x)>>(y)
#define IN3(x,y,z) cin >>(x)>>(y)>>(z)

#define HR cout<<"\n-------------------------\n"
#define LINE cout<<"\n" 


void i_o() {
	
	#ifndef ONLINE_JUDGE
		freopen("input.txt", "r", stdin);
		freopen("output.txt", "a", stdout);

        cout << __FILE__ << endl;
    #else
        ios_base::sync_with_stdio(false);
	    cin.tie(0);
	    cout.tie(0);
	#endif
}

typedef vector<int> vi;
typedef vector<string> vs;

template <typename T> void inpA      (T arr[], int n)         { FOR1(i,n){ IN(arr[i]); } }
template <typename T> void inpV         (vector<T> &vec, int n) { 
    vec.resize(n);
    for(int i=0; i<n; i++) cin >> vec[i] ;
}
template <typename T> void outV      (vector<T> &vec) { 
    for(int i=0; i<vec.size(); i++) cout << vec[i] << " " ;
    cout << endl ;
}

template <typename T> void sortV        (vector<T> &vec)            { sort(vec.begin(), vec.end() ) ; }
template <typename T> void rSortV       (vector<T> &vec)            { sort(vec.begin(), vec.end(), greater<T>()) ; }
template <typename T> bool bSearchV      (vector<T> &vec, T key)     { return binary_search(vec.begin(), vec.end(), key) ; }

#pragma endregion 


//----------------------------------------------------
//---------START OF SOLUTION--------------------------
//----------------------------------------------------


// global var

void pre(){

}

template <typename T> lli sumV      (const vector<T> &vec) { 
    lli res=0;
    for(int i=0; i<vec.size(); i++) res +=vec[i] ;
    return res;
    
}

int main(){
    #ifndef ONLINE_JUDGE
        clock_t clock_begin = clock();
	#endif

    i_o();
    pre();
        
    // ----- START





    

    lli t;
    lli ans;
    // define all variables
    


    int n;
    
    cin>>t ;
    while(t--){
        // input

        cin >> n ;

        vi a;
        inpV(a,n);
        vi b;
        inpV(b,n);

        lli sumA = sumV(a);
        lli sumB = sumV(b);

        vi incr, decr;

        if(sumA != sumB){
            ans = -1;
            cout << ans << endl ;
        }
        else{
            for(int i=0; i<n; i++){
                if(a[i]<b[i]){
                    // needs increment
                    for(int j=0; j<b[i]-a[i]; j++){
                        incr.push_back(i+1);
                    }
                }
                else if(a[i]>b[i]){
                    
                    for(int j=0; j<a[i]-b[i]; j++){
                        decr.push_back(i+1);
                    }
                }
            }

            // print them 

            int m = incr.size();
            cout << m << endl ;

            while(incr.size() != 0){
                OUT2(decr.back(), incr.back());
                decr.pop_back(), incr.pop_back() ;
            }

        }

        // intitialise loop specific variables


        // print ans
        
    }


    // ---- END



    #ifndef ONLINE_JUDGE
        clock_t clock_end = clock();
        HR;
        cout<<"Executed In : "<<double(clock_end-clock_begin)/CLOCKS_PER_SEC*1000<<" ms";
        HR;
	#endif

    return 0 ;

}

