#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int a, b, c, d, k;
    cin >> a >> b >> c >> d >> k;
    double pencils = a / (c * 1.00);
    double pens = b / (d * 1.00);
    int numPencils = ceil(pencils), numPens = ceil(pens);
    if (numPencils + numPens <= k) {
      cout << numPencils << " " << numPens << endl;
    } else {
      cout << "-1" << endl;
    }
  }
  return 0;
}
