#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, a, b, c, d, e;
  cin >> t;
  while (t--) {
    cin >> a >> b >> c >> d >> e;
    int ans1 = (ceil)(a * 1.0 / c);
    int ans2 = (ceil)(b * 1.0 / d);
    if (ans1 + ans2 > e) {
      cout << -1 << endl;
      continue;
    }
    cout << ans1 << " " << ans2 << endl;
  }
  return 0;
}
