#include <bits/stdc++.h>
const double pi = 3.14159;
using namespace std;
void Mahmoud() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
bool palindrome(string s) {
  string x;
  x = s;
  reverse(s.begin(), s.end());
  if (s == x)
    return 1;
  else
    return 0;
}
int main() {
  Mahmoud();
  int t;
  cin >> t;
  while (t--) {
    int a, b, c, d, k, res = 0, x, y;
    cin >> a >> b >> c >> d >> k;
    if (a % c == 0) {
      x = a / c;
    } else {
      x = (a / c) + 1;
    }
    res += x;
    if (b % d == 0) {
      y = b / d;
    } else {
      y = (b / d) + 1;
    }
    res += y;
    if (res <= k)
      cout << x << " " << y << '\n';
    else
      cout << -1 << '\n';
  }
  return 0;
}
