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