#include <bits/stdc++.h>
using namespace std;
int main() {
  long long a, b, c, d, k;
  long long t;
  cin >> t;
  for (long long i = 0; i < t; ++i) {
    cin >> a >> b >> c >> d >> k;
    a = (a % c == 0) ? (a / c) : ((a / c) + 1);
    b = (b % d == 0) ? (b / d) : ((b / d) + 1);
    if (a + b > k)
      cout << -1 << endl;
    else
      cout << a << " " << b << endl;
  }
}
