#include <iostream>
#include <string>
#include <bits/stdc++.h>
#include <fstream>

using namespace std;

int main() {
    int t; cin >> t;
    while (t--) {
        int n, a[105], b[105], cnti = 0, cntj = 0;
        map<int, int> mi;
        map<int, int> mj;
        cin >> n;
        for (int i = 1; i <= n; i++) {
            cin >> a[i];
        }
        for (int i = 1; i <= n; i++) {
            cin >> b[i];
        }
        for (int i = 1; i <= n; i++) {
            if (a[i] > b[i]) {
                cnti += a[i] - b[i];
                mi[i] = a[i] - b[i];
            }
            else if (a[i] < b[i]) {
                cntj += b[i] - a[i];
                mj[i] = b[i] - a[i];
            }
            else {
                continue;
            }
        }
        if (cnti != cntj) {
            cout << "-1" << endl;
        }
        else if (cnti == 0 && cntj == 0) {
            cout << "0" << endl;
        }
        else if (cnti == cntj) {
            cout << cnti << endl;
            while (cnti--) {
                int i = 0, j = 0;
                for (int k = 1; k <= n; k++) {
                    if (mi[k] > 0 && i == 0) {
                        i = k;
                        mi[k]--;
                    }
                    else if (mj[k] > 0 && j == 0) {
                        j = k;
                        mj[k]--;
                    }
                }
                cout << i << " " << j << endl;
            }
        }
    }
    return 0;
}