/* بِسْمِ اللَّهِ الرَّحْمَٰنِ الرَّحِيمِ */
#define INPUT FASTIO;
//#define INPUT freopen("test.txt", "r", stdin);
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> pll;
#define FASTIO ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
#define mp make_pair
#define pb push_back
#define sz(v) ((int)v.size())
#define all(v) v.begin(), v.end()
#define parseArray(A, n) for ( ll K = 0; K < n; K++) { cin >> A[K]; }
#define debug(c) for (auto e: c) cerr << e << " "; cerr << endl;
ll modInverse(ll a, ll b){ return 1<a ? b - modInverse(b%a, a)*b/a : 1; }
ll gcd(ll a, ll b){ return b?gcd(b, a % b):a; }
ll lcm(ll a, ll b){ return (a*b)/gcd(a, b); }
#define PI 3.14159265358979323846
#define uniq(v) v.resize(distance(v.begin(), unique(all(v))))
#define low_b(v, x) lower_bound(all(v), x) - v.begin()

int main(){ 
  INPUT
  ll t; cin >> t;
  while (t--) {
    ll n; cin >> n;
    ll a[n], b[n]; parseArray(a, n); parseArray(b, n);
    ll sa = 0, sb = 0;
    for ( int k = 0; k < n; k++ ){
      sa += a[k], sb += b[k];
    }
    if (sa != sb) {
      cout << -1 << '\n';
      continue;
    }
    vector<pll> ans;
    vector<ll> pos, neg;
    for ( int k = 0; k < n; k++ ){
      if (a[k] > b[k])
        pos.pb(k);
      else if (a[k] < b[k])
        neg.pb(k);
    }
    for (ll i: pos) {
      while (a[i] > b[i]) {
        if (a[neg.back()] == b[neg.back()])
          neg.pop_back();
        ans.pb({i + 1, neg.back() + 1});
        a[i]--, a[neg.back()]++;
      }
    }
    cout << sz(ans) << '\n';
    for (auto p: ans)
      cout << p.first << " " << p.second << '\n';
  }
  return 0;
}
