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