#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  int a, b, c, d, k;
  int i = 0;
  while (i < t) {
    i++;
    cin >> a >> b >> c >> d >> k;
    int tt = ceil(float(a) / float(c));
    int ttt = ceil(float(b) / float(d));
    if (tt + ttt > k) {
      cout << "-1" << endl;
      continue;
    }
    cout << tt << " " << ttt << endl;
  }
  return 0;
}
