# include <bits/stdc++.h>
using namespace std;

# define fori(i,n)          for(int i=0;i<n;i++)
# define forl(i,n)          for (ll i=0;i<n;i++)
# define pb                 push_back
# define X                  first
# define Y                  second
# define all(v)             v.begin(),v.end()
# define in_ar_int(arr,n)   int arr[n]; fori(i,n) cin >> arr[i];
# define in_ar_ll(arr,n)    ll arr[n]; fori(i,n) cin >> arr[i];
# define endl               "\n"
# define mod                1000000007
# define pi                 3.1415926536
# define intn               int n;cin>>n
# define MOD                1000000007
# define deb(x)             cout << #x << " = " << x << endl;
# define deb2(a,b)          cout << #a << " = " << a << " and " << #b << " is " << b << endl;

typedef long long ll;
//gcd(a,b) = gcd(a,b-a)

void solve(){
    ll n; cin>>n;
    vector<ll> a(n), b(n);
    ll odd = 0, even = 0;
    fori(i, n) {
        cin>>a[i];
        odd += a[i];
    }
    fori(i, n) {
        cin>>b[i];
        even += b[i];
    }

    if(odd != even) {
        cout<<-1<<endl; return;
    }
    vector<ll> in, de;
    fori(i, n) {
        if(a[i]>b[i]) {
            for(int j=0;j<abs(a[i]-b[i]);j++) {
                de.push_back(i+1);
            }
        }
        else {
            for(int j=0;j<abs(a[i]-b[i]);j++){
                in.push_back(i+1);
            }
        }
    }
    cout<<in.size()<<endl;
    fori(i, in.size()) {
        cout<<de[i]<<" "<<in[i]<<endl;
    }
}     

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL);
    int chill=1;
    cin >> chill;
    while(chill--){
        solve();
    }
}