#include <bits/stdc++.h>
using namespace std;
template <typename... Args>
void logger(string vars, Args &&...values) {
  cout << vars << " = ";
  string delim = "";
  (..., (cout << delim << values, delim = ", "));
}
vector<int> isPrime(20, 1);
void seive(int range) {
  isPrime[0] = isPrime[1] = 0;
  for (int i = 2; i * i <= range; i++)
    if (isPrime[i])
      for (int j = i * i; j <= range; j += i) isPrime[j] = i;
}
long long mod_expo(long long n, long long exp, long long p = 1e9 + 7) {
  long long res = 1;
  while (exp > 0) {
    if (exp & 1) {
      res = ((res % p) * (n % p)) % p;
      exp--;
    };
    n = ((n % p) * (n % p)) % p;
    exp >>= 1;
  }
  return res;
}
int checkPrime(int n) {
  if (n == 1 or n == 0) return -1;
  for (int i = 2; i * i <= n; i++) {
    if (n % i == 0) {
      return -1;
    }
  }
  return 1;
}
void solve() {
  int a, b, c, d, k, x = 1, y = 1;
  cin >> a >> b >> c >> d >> k;
  int s1 = 0, s2 = 0;
  while (a > s1 + c) {
    s1 += c;
    x++;
  }
  while (b > s2 + d) {
    s2 += d;
    y++;
  }
  int diff = (k - (x + y)) / 2;
  x += diff;
  y += diff;
  if (y * d < b or x * c < a)
    cout << (-1) << '\n';
  else if (x + y <= k)
    cout << x << " " << y << '\n';
  else
    cout << (-1) << '\n';
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int ts = 1;
  cin >> ts;
  while (ts--) {
    solve();
  }
  return 0;
}
