#include <bits/stdc++.h>
using namespace std;
int const N = 1e5 + 64;
int main() {
  double pencil;
  double pen;
  int t;
  cin >> t;
  for (int i = 0; i < t; i++) {
    double a;
    double b;
    double c;
    double d;
    double k;
    cin >> a >> b >> c >> d >> k;
    double x = a / c;
    pen = ceil(a / c);
    pencil = ceil(b / d);
    int total = pen + pencil;
    if (total <= k) {
      cout << pen << " " << pencil << endl;
    } else {
      int no = -1;
      cout << no << endl;
    }
  }
}
