//   __________________
//  | ________________ |
//  ||          ____  ||
//  ||   /\    |      ||
//  ||  /__\   |      ||
//  || /    \  |____  ||
//  ||________________||
//  |__________________|
//  \###################\
//   \###################\
//    \        ____       \
//     \_______\___\_______\

#include<bits/stdc++.h>

using namespace std;

using pii = pair<int, int>;


#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define MOD 1000000007
#define MOD1 998244353
#define INF 1e18
#define nline "\n"
#define pb push_back
#define ppb pop_back
#define mp make_pair
#define ff first
#define Sum(v) accumulate(v.begin(), v.end(), 0)
#define maxi(v) *max_element(v.begin(), v.end())
#define mini(v) *min_element(v.begin(), v.end())
#define F(a, i, n) int n; cin>>n; vector<int> a(n);for(int i=0;i<n;i++) {cin>>a[i];}
#define Sort(v) sort(v.begin(), v.end())
#define minpq priority_queueeue<ll, vector<ll>, greater<ll> >
#define maxpq priority_queue<ll>

#define ss second
#define PI 3.141592653589793238462
#define set_bits __builtin_popcountll
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()

typedef long long ll;
typedef unsigned long long ull;
typedef long double lld;
// typedef tree<pair<int, int>, null_type, less<pair<int, int>>, rb_tree_tag, tree_order_statistics_node_update > pbds; // find_by_order, order_of_key

#ifndef ONLINE_JUDGE
#define debug(x) cerr << #x <<" "; _print(x); cerr << endl;
#else
#define debug(x)
#endif

void _print(ll t) {cerr << t;}
void _print(int t) {cerr << t;}
void _print(string t) {cerr << t;}
void _print(char t) {cerr << t;}
void _print(lld t) {cerr << t;}
void _print(double t) {cerr << t;}
void _print(ull t) {cerr << t;}

template <class T, class V> void _print(pair <T, V> p);
template <class T> void _print(vector <T> v);
template <class T> void _print(set <T> v);
template <class T, class V> void _print(map <T, V> v);
template <class T> void _print(multiset <T> v);
template <class T, class V> void _print(pair <T, V> p) {cerr << "{"; _print(p.ff); cerr << ","; _print(p.ss); cerr << "}";}
template <class T> void _print(vector <T> v) {cerr << "[ "; for (T i : v) {_print(i); cerr << " ";} cerr << "]";}
template <class T> void _print(set <T> v) {cerr << "[ "; for (T i : v) {_print(i); cerr << " ";} cerr << "]";}
template <class T> void _print(multiset <T> v) {cerr << "[ "; for (T i : v) {_print(i); cerr << " ";} cerr << "]";}
template <class T, class V> void _print(map <T, V> v) {cerr << "[ "; for (auto i : v) {_print(i); cerr << " ";} cerr << "]";}




void solve() {

    int n;
    cin >> n;
    vector<int> v1(n);
    vector<int> v2(n);
    for (int i = 0; i < n; i++) cin >> v1[i];

    for (int i = 0; i < n; i++) cin >> v2[i];

    vector<pair<int, int>> ans(n);
    for (int i = 0; i < n; i++) {
        ans[i] = {(v2[i] - v1[i]), i};
    }

    int cnt1 = 0 ;
    int cnt2 = 0;
    for (auto i : ans) {
        if (i.first < 0) cnt1 += abs(i.first);
        if (i.first > 0) cnt2 += abs(i.first);
    }

    if (cnt1 != cnt2) {
        cout << "-1" << endl;
        return;
    }
    int  cnt = 0;
    vector<pair<int, int >> res;

    sort(ans.begin(), ans.end());
    int i = 0;
    int j = n - 1;
    while (i < j) {
        if (abs(ans[i].ff) > abs(ans[j].ff)) {
            int p = abs(ans[j].ff);
            while (p--) {
                res.pb({ans[i].ss, ans[j].ss});
                ans[i].ff++;
                ans[j].ff--;
                cnt++;
            }
            j--;
        }
        else if (abs(ans[i].ff) < abs(ans[j].ff)) {
            int p = abs(ans[i].ff);
            while (p--) {
                res.pb({ans[i].ss, ans[j].ss});
                ans[i].ff++;
                ans[j].ff--;
                cnt++;
            }
            i++;

        }
        else {
            int p = abs(ans[i].ff);
            while (p--) {
                res.pb({ans[i].ss, ans[j].ss});
                ans[i].ff++;
                ans[j].ff--;
                cnt++;
            }
            i++;
            j--;
        }
    }

    cout << cnt << endl;
    for (auto i : res) cout << i.ff + 1 << ' ' << i.ss + 1 << endl;

    // cout << endl;






}
int main() {
#ifndef ONLINE_JUDGE
    freopen("Error.txt", "w", stderr);
#endif


#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    fast

    ll tt;
    cin >> tt;

    while (tt--) {
        solve();
    }

}