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