#include <bits/stdc++.h>
#define ll long long int
#define st string
#define pb(x) push_back(x)
#define sz size()
using namespace std;
const ll maxn=1e5+1,maxv=1e6,mod=1e9;
ll a1[maxn];
ll b1[maxn];
int main()
{   std::ios_base::sync_with_stdio(false);cin.tie(0),cout.tie(0);
    ll t,n,m,a,b,c;
    cin>>t;
    while(t--){
        cin>>n;a=0,b=0,c=0;
        for(int i=1;i<=n;i++){
            cin>>a1[i];
            a+=a1[i];
        }
        for(int i=1;i<=n;i++){
            cin>>b1[i];
            b+=b1[i];
            c+=(abs(a1[i]-b1[i]));
        }
        if(a!=b)
            cout<<-1<<endl;
        else{
            cout<<c/2<<endl;
            for(int i=1;i<=n;i++){
                if(a1[i]>b1[i]){
                    for(int j=1;j<=n;j++){
                        if(b1[j]>a1[j]){
                            ll mn=min((a1[i]-b1[i]),(b1[j]-a1[j]));
                            a1[i]-=mn;
                            a1[j]+=mn;
                            while(mn--){
                                cout<<i<<" "<<j<<endl;
                            }
                        }
                    }
                    i-=2;
                }
            }
        }
    }
}
