#include <bits/stdc++.h>
using namespace std;
int main() {
  int a = 0, b = 0, c = 0, d = 0, e = 0, f = 0, k = 0, t = 0;
  cin >> t;
  for (; t--;) {
    cin >> a >> b >> c >> d >> k;
    e = ceil((double)a / c);
    f = ceil((double)b / d);
    if (e + f > k) {
      cout << -1 << endl;
    } else {
      cout << e << ' ' << f << endl;
    }
  }
  return 0;
}
