/**
    AUTHOR
    RAGHUPATHI NAIDU

    @🇷​​​​​🇦​​​​​🇬​​​​​🇭​​​​​🇺​​​​​_🇸​​​​​🇵​​​​​🇦​​​​​🇷​​​​​🇰​​​​​

**/

#include <bits/stdc++.h>

using namespace std;

typedef long long int ll;
typedef long double ld;
typedef unsigned long long ull;

#define INF 0x3f3f3f3f
#define e 2.718281828459045
#define INT_MAX __INT_MAX__
#define INT_MIN (-INT_MAX - 1)

#define pll pair<ll, ll>
#define pcl pair<char, ll>
#define triplet pair<ll, pair<ll, ll>>
#define vl vector<ll>
#define vc vector<char>
#define vb vector<bool>
#define vvl vector<vector<ll>>
#define vvc vector<vector<char>>
#define mll map<ll, ll>
#define umll unordered_map<ll, ll>
#define pq_down priority_queue<ll>
#define pq_up priority_queue<ll, vector<ll>, greater<ll>>
#define pb push_back
#define pf push_front
#define F first
#define S second

#define FASTIO ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);

#define read(a)                             \
    for (int i = 0; i < (int)a.size(); ++i) \
    cin >> a[i]
#define display(v)                          \
    for (int i = 0; i < (int)v.size(); ++i) \
    {                                       \
        cout << v[i] << " ";                \
        if (i % 2 == 1)                     \
            cout << "\n";                   \
    }

#define nl cout << "\n"

#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()

#define vsort(a) sort(a.begin(), a.end())
#define vrsort(a) sort(a.begin(), a.end(), greater<ll>())

#define yes cout << "YES\n"
#define no cout << "NO\n"

#define google cout << "Case #" << i << ": "

#define prec(n, output) cout << fixed << setprecision(n) << output << "\n"

/* CONSTANTS */

const ld pi = acos(-1);
const int mod = 1e9 + 7;

/* FUNCTIONS */

ll mod_add(ll a, ll b, ll m)
{
    a = a % m;
    b = b % m;
    return (((a + b) % m) + m) % m;
}
ll mod_mul(ll a, ll b, ll m)
{
    a = a % m;
    b = b % m;
    return (((a * b) % m) + m) % m;
}
ll mod_sub(ll a, ll b, ll m)
{
    a = a % m;
    b = b % m;
    return (((a - b) % m) + m) % m;
}
ll power(ll x, ll y)
{
    ll p = mod, res = 1;
    x = x % p;
    while (y > 0)
    {
        if (y & 1)
            res = (res * x) % p;
        y = y >> 1;
        x = (x * x) % p;
    }
    return res;
}
ll gcd(ll a, ll b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);
}

void solve();

int main()
{
    FASTIO;
    ll t = 1;
    cin >> t;
    for (ll i = 1; i <= t; i++)
    {
        // google;
        solve();
    }
}

void solve()
{
    ll n;
    cin >> n;
    ll asum = 0, bsum = 0;
    ll cnt = 0;
    vl a(n), b(n);
    for (int i = 0; i < n; i++)
    {
        cin >> a[i];
        asum += a[i];
    }
    vector<pll> po, ne;
    for (int i = 0; i < n; i++)
    {
        cin >> b[i];
        bsum += b[i];
        if (a[i] > b[i])
        {
            po.push_back(make_pair(i, a[i] - b[i]));
        }
        else if (a[i] < b[i])
        {
            ne.push_back(make_pair(i, b[i] - a[i]));
        }
    }
    if (asum != bsum)
    {
        cout << "-1\n";
        return;
    }
    int i = 0, j = 0;
    vl ans;
    while (i < po.size())
    {
        for (int k = 1; k <= po[i].second; k++)
        {
            if (ne[j].second <= 0)
                j++;
            if (j >= ne.size())
                break;
            cnt++;
            ans.push_back(po[i].first + 1);
            ans.push_back(ne[j].first + 1);
            ne[j].second--;
        }
        i++;
    }
    cout << cnt << "\n";
    display(ans)
}