#include <bits/stdc++.h>
using namespace std;
vector<long long> v[300005];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n, m, j, l = 0, p = 0, q = 0, i, flag = 0, t, k, r = 0;
  cin >> t;
  while (t--) {
    long long a, b, c, d, k;
    cin >> a >> b >> c >> d >> k;
    long long t1 = a / c;
    long long t2 = b / d;
    long long t3 = a % c;
    long long t4 = b % d;
    if (t3 != 0) {
      t1++;
    }
    if (t4 != 0) {
      t2++;
    }
    long long t5 = t1 + t2;
    if (t5 <= k) {
      cout << t1 << " " << t2 << '\n';
    } else {
      cout << -1 << '\n';
    }
  }
  return 0;
}
