#include <bits/stdc++.h>

using namespace std;
#define pb push_back
#define mp make_pair
#define rep(i,a,b) for (int i = a; i < b; ++i)

typedef pair<int,int> pi;
typedef vector<string> vs;
typedef long long  ll;
typedef vector<int> vi;
typedef vector<ll> vl;
const int mod = 1e9+7;
const int INF{INT_MAX};
const ll LINF {LLONG_MAX};
template <typename T>
void debug(T a){cout << a << endl;}

void solve(){

int n;
cin >> n;

vi a(n);
vi b(n);

rep(i, 0, n){
    cin >> a.at(i);
}

rep(i, 0, n){
    cin >> b.at(i);
}

int ans1{0};
int ans2{0};

rep(i, 0, n){
    if(a.at(i) > b.at(i)){
        ans1 += a.at(i) - b.at(i);
    }
        else if(b.at(i) > a.at(i)){
            ans2 += b.at(i) - a.at(i);
        }
}

if(ans1 == ans2){
    cout << ans1 << '\n';
}
    else{
        cout << -1 << '\n';
        return;
    }

vi numsa;
vi numsb;

rep(i, 0, n){
    if(a.at(i) > b.at(i)){
        while(a.at(i) != b.at(i)){
            numsa.pb(i+1);
            --a.at(i);
        }
    }
        else if(a.at(i) < b.at(i)){
            while(a.at(i) != b.at(i)){
                numsb.pb(i+1);
                ++a.at(i);
            }
        }
}

rep(i, 0, numsa.size()){
    cout << numsa.at(i) << " " << numsb.at(i) << '\n';
}

return;
}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    #ifndef ONLINE_JUDGE
    freopen("input", "r", stdin);
    #endif
    int t{0};
    cin >> t;

    while(t--){
     solve();
    }



return 0;
}