#include<bits/stdc++.h>
#define endl '\n'
#define mt make_tuple
#define pb push_back
#define ff first
#define ss second
#define ALL(v) v.begin(), v.end()


using namespace std;
using ll = long long;
using ld = long double;

const int maxn = 100005;
const ll INF = 1e18;
const ll mod = 1e9 + 7;

ll POW(ll a, ll b, ll MMM = mod) {ll ret=1; for(;b;b>>=1,a=(a*a)%MMM)if(b&1)ret=(ret*a)% MMM; return ret; }

int go_vishal(){
  int n;
  cin >> n;
  vector<int> a(n), b(n);
  for(auto &x : a){
    cin >> x;
  }
  vector<int> lower, upper;
  int diff = 0;
  for(int i = 0; i < n; i++){
    cin >> b[i];
    if(a[i] < b[i]){
      lower.pb(i);
    }
    if(a[i] > b[i]){
      upper.pb(i);
    }
    diff += a[i] - b[i];
  }

  if(diff != 0){
    cout << -1 << endl;
    return 0;
  }

  vector<pair<int, int>> ans;
  while(lower.size() != 0 && upper.size() != 0){
    int i = lower.back();
    a[i] += 1;
    int j = upper.back();
    a[j] -= 1;
    ans.pb({i+1, j+1});
    if(a[i] == b[i]){
      lower.pop_back();
    }
    if(a[j] == b[j]){
      upper.pop_back();
    }
  }

  cout << ans.size() << endl;
  for(auto x : ans){
    cout << x.ss << " " << x.ff << endl;
  }
  return 0;
}


int main(){
  ios::sync_with_stdio(0);
  cin.tie(0), cout.tie(0);
  int tt;
  tt = 1;
  cin >> tt;
  for(int i = 1; i <= tt; i++){
      go_vishal();
  }
  return 0;
}

