#include <bits/stdc++.h>
using namespace std;
 
using ll = long long;

void solve() {
    int n;
    cin >> n;

    vector<int> a(n), b(n);
    for(int& i: a)  cin >> i;
    for(int& i: b)  cin >> i;

    ll sum = accumulate(a.begin(), a.end(), 0LL);
    sum = accumulate(b.begin(), b.end(), -sum);
    if(sum != 0) {
        cout << "-1\n";
        return;
    }

    vector<pair<int, int> > res;
    for(int i = 0; i < n; i++) {
        while(a[i] != b[i]) {
            for(int j = i + 1; j < n; j++) {
                while((a[i] > b[i]) && (a[i] > b[i]) == (a[j] < b[j])) {
                    res.push_back({i + 1, j + 1});
                    a[i]--;
                    a[j]++;
                } 
                while((a[i] < b[i]) && (a[i] < b[i]) == (a[j] > b[j])) {
                    res.push_back({j + 1, i + 1});
                    a[j]--;
                    a[i]++;
                }
            }
        }
    }

    cout << res.size() << '\n';
    for(auto &pi: res)
        cout << pi.first << " " << pi.second << '\n';
}

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    
    int t;
    cin >> t;
    while(t--) {
        solve();
    }
}
