#include <bits/stdc++.h>
using namespace std;
#define FAST ios::sync_with_stdio(0), cin.tie(0),cout.tie(0)
#define MP make_pair
#define PB push_back
#define all(x) x.begin(),x.end()
#define rep(i,n) for(ll i=0;i<n;i++)
#define repinv(i,n) for(ll i=n-1;i>-1;i--)
#define MOD 998244353
#define endl '\n'
typedef long long ll;
int t1[105],t2[105];
unordered_map<int,int> mp;
int main(){
    FAST;

    int tc;
    cin>>tc;
    int n;
    ll so1,so2;
    while(tc--){
        mp.clear();
        so1=0;
        so2=0;
        cin>>n;
        rep(i,n){
            cin>>t1[i];
            so1+=t1[i];
        }
        rep(j,n){
            cin>>t2[j];
            so2+=t2[j];
        }
        if(so1!=so2){
            cout<<-1<<endl;
            continue;
        }
        for(int i=0;i<n;i++){
            if(t1[i]>t2[i])
                mp[i]+=t1[i]-t2[i];
        }
        vector<pair<int,int>> v;
        int nb;
        for(int i=0;i<n;i++){
            nb=0;
            if(t1[i]<t2[i])
                for(int j=0;j<n;j++){
                    if(nb<(t2[i]-t1[i])){
                        while(mp[j]!=0&&(nb<t2[i]-t1[i])){
                            mp[j]--;
                            v.push_back({j+1,i+1});
                            nb++;
                        }
                    }
                    else
                        break;
                }

        }
        cout<<v.size()<<endl;
        for(auto it:v)
            cout<<it.first<<" "<<it.second<<endl;

    }




}
