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

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
#define fast ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
#define INF 1e18
#define pb push_back
#define pob pop_back
#define ff first
#define endl "\n"
#define ss second
#define PI 3.141592653589793238462
#define setbits __builtin_popcountll
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()

// 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 bug(x)         \
    cerr << #x << " "; \
    _print(x);         \
    cerr << endl;
#else
#define bug(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(ld 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()
{

    ll n, k, m;

    cin >> n;
    int a[n];
    int b[n];

    vector<pair<int, int>> sm, bg, ans;

    int sum1 = 0;
    int sum2 = 0;

    for (int i = 0; i < n; i++)
    {
        cin >> a[i];
        sum1 += a[i];
    }
    for (int i = 0; i < n; i++)
    {
        cin >> b[i];
        sum2 += b[i];
    }
    if (sum2 != sum1)
    {
        cout << -1 << endl;
        return;
    }

    for (int i = 0; i < n; i++)
    {
        if (a[i] < b[i])
        {
            sm.push_back({i, b[i] - a[i]});
        }
        else if (a[i] > b[i])
        {
            bg.push_back({i, a[i] - b[i]});
        }
    }

    int x = 0;
    int y = 0;

    while (x < sm.size() && y < bg.size())
    {
        int c = min(sm[x].second, bg[y].second);

        for (int i = 0; i < c; i++)
        {
            ans.push_back({sm[x].first, bg[y].first});
        }

        sm[x].second -= c;
        bg[y].second -= c;

        if (sm[x].second == 0)
            x++;
        if (bg[y].second == 0)
            y++;
    }

    if (x == sm.size() && y == bg.size())
    {
        cout << ans.size() << endl;
        for (auto an : ans)
        {
            cout << an.second + 1 << " " << an.first + 1 << endl;
        }
    }
    else
    {
        cout << -1 << endl;
    }
}

int main()
{
#ifndef ONLINE_JUDGE

#endif
    fast int t = 1;
    cin >> t;
    while (t--)
    {
        solve();
    }
    return 0;
}
