/*
Author : Prathamesh Wagh
*/
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,fma")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>  

using namespace std;
int MOD = 998244353;
#define int long long
#define dbg(x) cout<<#x<<" = "<<x<<"\n"
#define pb push_back
#define fi first
#define se second

#define fast_cin() ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)


void solve(){
    int n;
    cin >> n;
    vector<int> a(n);
    vector<int> b(n);
    for(int i=0;i<n;i++){
        cin >> a[i];
    }
    for(int i=0;i<n;i++){
        cin >> b[i];
    }
    vector<vector<int>> ans;
    for(int i=0;i<n;i++){
        if(a[i] != b[i]){
            for(int j=i+1;j<n;j++){
                while(a[i] < b[i] && a[j] > b[j]){
                    ans.push_back({j+1,i+1});
                    a[i]++;
                    a[j]--;
                }
                while(a[i] > b[i] && a[j] < b[j]){
                    ans.push_back({i+1,j+1});
                    a[i]--;
                    a[j]++;
                }
            }
        }
    }
    for(int i=0;i<n;i++){
        if(a[i] != b[i]){
            cout << -1 << "\n";
            return ;
        }
    }
    cout << ans.size() << "\n";
    for(auto it : ans){
        cout << it[0] << " " << it[1] << "\n";
    }
}
int32_t main()
{
    fast_cin();
    int t;
    cin >> t;
    while(t--) {
        solve();
    }
    return 0;
}