#include<bits/stdc++.h>
using namespace std;
#define int long long
long double eps = 1e-9;
int n;
int mod = 1e9 + 7;


void solve()
{

cin>>n;
vector<int>A(n);
vector<int>B(n);
int sum1=0;
for(int i=0;i<n;i++)
{
    cin>>A[i];
    sum1+=A[i];
}
int sum2=0;
for(int i=0;i<n;i++)
{
    cin>>B[i];
    sum2+=B[i];
}

if(sum1!=sum2)
{
    cout<<-1;
return;

}
vector<int>a;
vector<int>b;
for(int i=0;i<n;i++)
{
    while(A[i]>B[i])
    {
        a.push_back(i);
        A[i]--;
    }
    while(A[i]<B[i])
    {
        b.push_back(i);
        A[i]++;
    }
}

cout<<a.size()<<endl;
for(int i=0;i<a.size();i++)
{
    cout<<a[i]+1<<" "<<b[i]+1<<endl;
}


}
int32_t main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);cout.tie(NULL);
    int T;
  // T=1;
   cin>>T;
    for(int t=1;t<=T;t++)

    {
        solve();
cout<<endl;
    }
    return 0;

}
