#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  double a, b, c, d, k, p, q;
  cin >> t;
  while (t--) {
    cin >> a >> b >> c >> d >> k;
    p = a / c;
    q = b / d;
    p = ceil(p);
    q = ceil(q);
    if (p + q <= k) {
      cout << p << " " << q << endl;
    } else
      cout << "-1" << endl;
  }
}
