#include <bits/stdc++.h>
using namespace std;
int64_t inf = 1000 * 1000 * 1000;
int64_t inf64 = inf * inf;
int main() {
  long long q, n, m, i, d, c, b, a, k;
  cin >> q;
  while (q--) {
    n = 0;
    cin >> a >> b >> c >> d >> k;
    if (a % c == 0)
      n += a / c;
    else
      n += a / c + 1;
    m = n;
    if (b % d == 0)
      n += b / d;
    else
      n += b / d + 1;
    if (n > k)
      cout << -1 << '\n';
    else
      cout << m << " " << k - m << '\n';
  }
}
