#include <bits/stdc++.h>
#include<iomanip>
#define ll long long
#define forplus(i,j,n) for(int i=j;i<=n;i++)
#define forminus(i,j,n) for(int i=n;i>=j;i--)
#define pii pair<int,int>
#define clr(x) memset(x,0,sizeof x)
#define clrmax(x) memset(x,0x3f,sizeof x)
#define clrmin(x) memset(x,0x80,sizeof x)
#define inf (int)2e5+7
using namespace std;


ll gcd(ll a,ll b)
{
    while(b)
    {
        ll tp=a%b;
        a=b;
        b=tp;
    }
    return a;
}


int numa[505];
int numb[505];

void solve()
{
    int t;cin>>t;
    int n;
    forplus(i,1,t)
    {
        cin>>n;
        forplus(j,1,n)
        {
            cin>>numa[j];
        }
        forplus(j,1,n)
        {
            cin>>numb[j];
            numb[j]-=numa[j];
        }
        int tot=0,pos=0;
        forplus(j,1,n)
        {
            if(numb[j]>0)
                pos+=numb[j];
            tot+=numb[j];
        }
        if(tot!=0)
            cout<<-1<<endl;
        else{
            cout<<pos<<endl;
            forplus(j,1,n)
            {
                while(numb[j]>0)
                {
                    forplus(k,1,n)
                    {
                        if(numb[k]<0)
                        {
                            numb[k]++;
                            cout<<k<<' '<<j<<endl;
                            break;
                        }
                    }
                    numb[j]--;
                }
            }
        }
    }
    
}


int main()
{
    ios::sync_with_stdio(false); 
    solve();
}